user347284
user347284

Reputation:

Symlink and hide dotfiles

How could I rename a bunch of dotfiles and add the leading dot in the same command? I see people writing:

ln -s vimrc .vimrc
ln -s gitconfig .gitconfig

But I would like something like this:

ln -s {vimrc,gitconfig} ~/.$1

Upvotes: 1

Views: 137

Answers (1)

falsetru
falsetru

Reputation: 369454

Using for loop:

for f in vimrc gitconfig; do ln -s  $f .$f ; done

If you have the filename list in a file:

for f in `cat filename_list.txt`; do mv $f .$f ; done

Upvotes: 1

Related Questions