How to create symbolic link in Linux?

Although the command to create a symbolic link in Linux is very simple, I never remember it. Every time I need to create a soft(symbolic) link in CentOS, I have to search google for the answer. In fact, the linux command to make a symbolic link is just as simple as:

ln -s file link

The problem is I never remember the order of file and symbolic link. If I put the soft link before the destination file, I got the wrong result. The source file must be put before the soft link in order to create a symbolic link to the source file. The symbolic link is kind of interesting. If you delete the soft link using “rm softlink”, you actually delete the link itself, not the file the soft link points to. But if you edit the source file using “vi softlink”, you are actually editing the destination file, not the symbolic link. After all, what can be edited for just a link?

Posted in tips of hosting