$ cat "

Quick Tip: Symbolic Links in Linux and Windows

"

Symbolic links are extremely useful for making long and annoying paths more accessible. Simply put you can make the target directory available through an alternative path.

On a Windows machine mklink is used to create symbolic links. Mklink is called as follows:


mklink new_path existing_path

and if you want to create a link to a directory you can add the /D flag. For example:

mklink /D c:\code c:\cygwin\home\erik\code

To remove the link you can delete the linked directory or file. DO NOT remove all the files in the linked folder, since that will actually remove them in the target folder as well.

If you are on a linux machine you use the ln and unlink commands instead:

ln -s /some/complicated/path/ /home/erik/stuff

To remove the link you use unlink:

unlink /some/linked/path
Written by Erik Öjebo 2012-10-19 20:00

    Comments