Symbolic Link or symlink is a linking system within in files and directories that points to another file or directory usually in UNIX ot Unix derivative OS. Symbolic Link can be created in Windows Operating System too, beside Linux, BSD and OS X. Symbolic Link is equivalent to the word Soft Link as unlike a hard link, this reference is not equivalent to the actual file system entry in the referenced file and deleting the original file makes the Symbolic Link invalid.
Basics About Symbolic Link or symlink
The advantage of using symbolic link is that these works over the partitions and are also on file system-wide they can easily point to a place which is not the case with the hard links. Although hard linking to directories in principle possible, but should be avoided and may be applied as a rule only by the system administrator. Symbolic link can confuse the users, as it seems at first glance as if the linked file is present simultaneously in multiple directories, deleting the original file, however, leads file loss.
Symbolic links to the directories can be problematic when users or programs deal with clueless directory trees. This creates an endless loop and thus a buffer overflow which leads to crashes or dangerous malfunctions. Unix tries to prevent this to some degree, by prohibiting to delete a symbolic link to a directory by the system command “rmdir” so clueless symbolic links prompt an error message if when wanting to remove such a link is done.
---
Using Symbolic Link or symlink
Using Symbolic Link in OS X :
ln (small letters of LN) command normally uses the link() unix call, which actually creates a hard link. If we use -s flag it will become a symlink() call, so the command will be ln -s
1 | ln -s <span style="color: #ff0000;">/target/path</span> <span style="color: #008000;">/link/path</span> |
Using Symbolic Link in Linux :
The usage is same like OS X. The command ls -l (small letters of LS -L) returns the output of the full path in both cases.
Using Symbolic Link in Windows OS :
As Windows is a closed source system, command line implementations are not very clear. Symlink in Windows OS is read only or has a system attribute. You have seen the files like start.lnk – these are symbolic files to the application. There is no exact ln -s command in Windows or rather the command is not known. desktop.ini is also a symbolic link pointing towards specific value of [.ShellClassInfo]. This is an example fake script to run shell script to create a symbolic link :
1 | ... |
1 | [HKEY_CLASSES_ROOTCLSID{ID}] |
1 | @="name" |
1 | [HKEY_CLASSES_ROOTCLSID{ID}DefaultIcon] |
1 | @="..." ; path to icon |
1 | [HKEY_CLASSES_ROOTCLSID{ID}Server32] |
1 | @="%SystemRoot%\System32\Doc.Dll" |
1 | [HKEY_CLASSES_ROOTCLSID{ID}Instance] |
1 | "CLSID"="{specific-ID}" |
1 | [HKEY_CLASSES_ROOTCLSID{ID}InstanceProperty] " |
1 | ... |
Please do not request me for writing any Windows related tutorials, you can read older tutorials like listed in Windows 7 Right Click Menu Tips,Tricks and Tutorials. Any Linux or OS X requests (Server/ Desktop) is always entertained.
Tagged With Symbolic Link command in Linux , symbolic link in unix