Cheatsheet: Difference between revisions

Line 718:
*The directories cannot be hard linked as Linux does not permit this to maintain the acyclic tree structure of directories.
*A hard link cannot be created across filesystems. Both the files must be on the same filesystems, because different filesystems have different independent inode tables (two files on different filesystems, but with same inode number will be different).
 
*How to find hard link in Linux
# find / -inum 517333
/home/bob/sync.sh
/root/synchro
 
;Remove files
* When rm command is issued, first it checks the link count of the file.
* If the link count is greater than 1, then it removes that directory entry and decreases the link count.
* Still, data is present, nor is the inode affected.
* And when link count is 1, the inode is deleted from the inode table, inode number becomes free, and the data blocks that this file was occupying are added to the free data block list.
 
== Hosts file ==