RSS

Hard link vs symbolic link

29 Dec

Hard link and symbolic link is the easy way to make file from one file logical.

Example: we have one data. But, we need two link linking to there. Hard link and symbolic link will do it. We’ll economize the memory.

Different between hardlink and symboliclink:

Compare

Hardlink

Symboliclink

Effect when edit

Yes

Yes

Effect when remove source

No

Yes

ID file

Same source

Different

 

Hard link:

is the linking in file system with two entry inode point  to same data physical. When we change data in that file then effect with together. But, When we remove entry inode, it doesn’t effect to other inode.

Symbolic link: same hard link but when source removed then symbolic link couldn’t open.

 

Command :

Create source :

$touch test.txt

And write some thing:

Create hardlink:

$ ln test.txt hardlink.txt

Create symboliclink:

$ ln -s test.txt symlink.txt

View ID file:

$ ls -lia

 

Example:

clip_image001[6]

  

 
 

Tags:

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s