Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何重命名一堆点文件并在同一命令中添加前导点?我看到人们在写:
ln -s vimrc .vimrc ln -s gitconfig .gitconfig
但我想要这样的东西:
ln -s {vimrc,gitconfig} ~/.$1
使用for循环:
for
for f in vimrc gitconfig; do ln -s $f .$f ; done
如果文件中有文件名列表:
for f in `cat filename_list.txt`; do mv $f .$f ; done