This document discusses hard and symbolic links in Linux file systems. It defines hard links as additional references to an inode that maintain the same permissions and access times as the original file. Symbolic links store the file path separately and can span file systems. The document provides instructions for creating hard and symbolic links using the ln command and explains how to identify them by listing directory contents. It also describes how multiple links can reference a single file and what happens when files or links are deleted.
8. CoreLinuxforRedHatandFedoralearningunderGNUFreeDocumentationLicense-Copyleft(c)AcácioOliveira2012
Everyoneispermittedtocopyanddistributeverbatimcopiesofthislicensedocument,changingisallowed
Hard link
hard link maintains the same permissions and access times of the original file
both have same inode number - simply appears to have different filename and/or location
8
Create and change hard and symbolic links
•Changes to either the original file or the link affect both.
•The two files have equal importance. But deleting either of files won’t affect the other.
•Hard link files appear to be regular files when examined and they function this way as
well
• Normal users can’t create hard links to directories.
• Also, hard links aren’t allowed to span file systems
To create a hard link, use the ln command
# ln stuff2 /home/angie/stuff
# ls –al
-rw-r--r-- 2 root root 89704 Aug 27 2000 stuff
-rw-r--r-- 2 root root 89704 Aug 27 2000 stuff2
Ex: