1

So I'm trying to create symlinks for my dotfiles (that way I can have a centralized dotfiles repository) but everytime I do this, iTerm won't read the symlinked files. Basically meaning I won't have access to any aliases or other configurations.

I believe I'm correctly symlinking the files by putting the link in the home directory and the actual file in the repository location with:

ln -s ~/.dot_file ~/Google\ Drive/Developer/git\ repositories/dotfiles/dot_file

I've also tried doing it the reverse way but then the repository doesn't have the contents of the file in the link. aka:

touch ~/Google\ Drive/Developer/git\ repositories/dotfiles/dot_file
mv .dot_file ~/Google\ Drive/Developer/git\ repositories/dotfiles/dot_file
cd ~/Google\ Drive/Developer/git\ repositories/dotfiles
ln -s dot_file ~/.dot_file

I've referenced these articles.

Help please! :)

Community
  • 1
  • 1
Alex Cory
  • 10,635
  • 10
  • 52
  • 62

1 Answers1

2

Your first example links the wrong way (it's ln -s source target, just like cp and mv).

In your second example, you create an invalid relative link.

You can use ls -l yourfile to see whether a file is a symlink, and see where it points.

What you'll want to do is:

cd ~ 
ln -s "Google Drive/Developer/git repositories/dotfiles/dot_file" ".dot_file"

Before you start, make sure you don't have a ~/.dot_file, and make sure your Google Drive/Developer/git repositories/dotfiles/dot_file is a regular file with the contents you want (again, with ls -l).

that other guy
  • 116,971
  • 11
  • 170
  • 194
  • I seriously want to shake your hand right now. Spent way too long trying to figure this stupid thing out. – Alex Cory May 17 '14 at 20:57