Linking files with ln

Links are of two types. Hard links and Symbolic links.

Hard links - Hard links are two files on a machine pointing to the same location on the hard-disk. The inodes of both the hard-linked files is the same. This means that even if you remove any of the files, the other file remains inremove hard link can be created in the following way.
ln source_file target_file

Symbolic links - A symbolic link is just a pointer to a file on the same filesystem. Symbolic links can be created to files on some other machine if the two machines are in the same network file system like (nfs). This is not possible with hard links, however. Purpose of creating a symbolic link can be to save space on network file system and avoid maintaining same copies of files in multiple locations. Symbolic links are created with -s option of the ln command in the following way.

ln -s source_file target_file

Unlike hard links, if source file is removed, the symbolic link contains nothing.

Back to Linux Tips

More Info

Don't forget to see our Tools' page and linux resources page
For Linux commands see - Useful Linux Tips

gnuServices interests

gnuServices tools...

Report Generation

Open Source

Report Generation is an integral part of enterprise application. We write Shell scripts for automation and Perl scripts for Report Generation of various kinds. More…

Knowledge Base

Website Applications

With Perl, PHP - We use CSS layouts which is the latest trends in web-designing. This has many advantages over the old-school web-design practices. If you would like to learn more about what it is, please visit www.zeldman.com. More…