Wednesday, June 22, 2011

Buat link file di Linux

ln - make symbolic links

A symbolic link is a "file" pointing to another file.
To make a symbolic link :
ln /original/file /new/link
This makes /original/file and /new/link the same file - edit one and the other will change. The file will not be gone until both /original/file and /new/link are deleted.
You can only do this with files. For folders, you must make a "soft" link.
To make a soft symbolic link :
ln -s /original/file /new/link
Example:
ln -s /usr/src/linux-2.4.20 /usr/src/linux
Note that -s makes an "empty" file pointing to the original file/folder. So if you delete the folder a symlink points to, you will be stuck with a dead symlink (just rm it).

No comments:

Post a Comment