Tuesday, July 17, 2007

Symbolic links in UNIX

Just a note to self here:

To create a symbolic link use the following command:
ln -s [source file or directory] [target name]

Note: I can't figure out how to overwrite sym-links to point to new things. It's easiest to delete the old link, then write the new one.

2 comments:

Alexandre said...

I always had some troubles remembering whether it's TARGET or LINK_NAME that comes first. Trick: make an analogy with the 'cp' command:

cp <existing> <new>
ln <existing> <new>

And, to rewrite a symbolic link use the -f flag. From 'man ln':

-f, --force
remove existing destination files

Erica said...

Thanks! And good luck with your GSoC project too!