How to create links in linux?

To create a link file we use the command ln in Linux. Using ln command we can create both hard link and symbolic (soft) link.


Hard Link

The syntax to create a hard link file is

ln target link_name
where target is the existing file and link_name is the name of the new link file

Example


Creating a hard link to an existing file, foo.txt


Symbolic Links

The syntax to create a soft link is 

ln -s target link_name
where target is the existing file and link_name is the name of the new link file

Example


Creating a symbolic link to an existing file foo.txt


For more options with ln command refer the man pages

Comments

Popular posts from this blog

Understanding awk command with examples

Understanding sed command with example -Part 1

How to install a Software in Linux