Creating links in Linux

Some notes on links in Linux systems

There are two types of links, soft link and hard links,

 

Soft Link

ln  -s  original_file  link_file

Stores the name of the original file, instead of the inode. If we rename the original file or move it to a directory, the soft link would no longer work.

Hard Link

ln  original_file  link_file

Is a link to the inode in the file system. The inode is removed if there is no hard links to the inode. If we move the original file or rename it, this would continue to work as the inode is the same.

Useful Links

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s