This article will show you how to create and delete symbolic links on a Linux system. A symbolic link is basically a file that points to another file. Note that there is only 1 copy of the actual file on the hard disk, thus saving valuable hard disk space by simply creating a link to it.
Creating a Symbolic Link
To create a symbolic link, use the syntax:
ln -s [directory or file to link] [the path of the new link]
For example, to create the link (or shortcut) /logs/mongrel.log that points to the actual file /usr/local/bin/mongrel/logs/mongrel.log, use the syntax:
ln -s /usr/local/bin/mongrel/logs/mongrel.log /logs/mongrel.log
Now, each time you want to view the mongrel.log file, you do not have to navigate to the original long path, simply go to the /logs folder
Note: You must create the /logs folder prior to creating the symbolic link
Removing/Deleting a Symbolic Link
Deleting a symbolic link is the same as removing a real file or directory. Simply use the command:
Note: Deleting the symbolic link does not delete the actual file, it only removes the link.