Changes

Jump to: navigation, search

Tutorial8: Links / Process Management

326 bytes removed, 09:56, 3 February 2020
Linking Files
<table align="right"><tr valign="top"><td>[[Image:hard-link-1.png|thumb|right|250px|(Image licensed under [https://creativecommons.org/licenses/by-sa/3.0/ cc])<br>Image manipulated by author]]]</td><td>[[Image:inode-number-3.png|thumb|right|500px|'''Hard links''' share the '''same inode number'''. Hard links are very good for '''backup''' purposes.]]</td></tr></table>
* A '''Hard link''' is a reference to the physical data on a file system* More than one hard link can be associated with the same physical data* Hard links can only refer to data that exists on the same file system* Hard links cannot be created to a directory* When a file has more than one link, you can remove any one link and still<br>be able to access the file through the remaining links.
An advantage with hard links is that if one hard link remains (even if original file has been removed), the data in that hard linked file is NOT lost. Also, hard links will automatically change when a change to that original file or hard links occur since they share the same '''i-node number''' and in the eyes of the Unix/Linux OS, they are the same files.
 
A disadvantage of hard links are that they take-up extra space, you cannot hard link directory files, and you cannot hard link files from other Unix/Linux servers (since the inode number may already be used by the other Unix/Linux server).
''Examples:''
An advantage with hard links is that if one hard link remains (even if original file has been removed), the data in that hard linked file is NOT lost. Also, hard links will automatically change when a change to that original file or hard links occur since they share the same '''i-node number''' and in the eyes of the Unix/Linux OS, they are the same files.
A disadvantage of hard links are that they take-up extra space, you cannot hard link directory files, and you cannot hard link files from other Unix/Linux servers (since the inode number may already be used by the other Unix/Linux server).
13,420
edits

Navigation menu