Skip to content

Instantly share code, notes, and snippets.

@mackuba
Created April 26, 2012 15:46
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mackuba/2500495 to your computer and use it in GitHub Desktop.
Save mackuba/2500495 to your computer and use it in GitHub Desktop.
Link all dotfiles from Dropbox
#!/bin/bash
for filename in `ls /Users/psionides/Dropbox/dotfiles`; do
name=`basename $filename .txt`
echo "Linking /Users/psionides/Dropbox/dotfiles/$filename to /Users/psionides/.$name..."
rm -f /Users/psionides/.$name
ln -s /Users/psionides/Dropbox/dotfiles/$filename /Users/psionides/.$name
done
echo "Done."
@ku1ik
Copy link

ku1ik commented Apr 26, 2012

Cool. Oh, and you can

ln -sf /Users/psionides/Dropbox/dotfiles/$filename /Users/psionides/.$name

and you don't need rm before.

@mackuba
Copy link
Author

mackuba commented Apr 26, 2012

Nice, thanks. I see that there's also -F that works with directories too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment