1.9 Links Flashcards
What is an inode?
The inode is used to store basic information about a file in a linux filesystem. It includes
- Size
- Device
- Owner
- Permissions
What is the difference between a hard link and a symbolic link?
- A hard link is a duplicate entry in the file system that points to a specific piece of data on the disk drive. It is indistinguishable from the oringinal file.
- A symbolic link points to another file system entry (the original), which in turn points to the contents (data) of the file.
How can you identify a symbolic link when using the ls -l command?
A symbolic link has a lower-case L as the first character in the permission string. For example, lrwxrwxrwx.
Which type of link is similar to shortcuts in Windows?
Symbolic links are similar to shortcuts in Windows
Which utilities can you use to create links?
Utilities to create links include ln and cp.
What is a hard link?
A hard link is a duplicate entry in the file system that points to a specific piece of data on the disk drive.
What are the features of a hard link?
- Points to the inode of an existing file.
- Is indistinguishable from the original file.
- Maintains a valid inode for the file data even if the original file is deleted.
- Has a dash (-) as the first character in the permission string (which is the same for original files). For example, -rwxr-xr-x.
What is a symbolic link?
A symbolic link (also known as a soft link) is a file system entry that points to another file system entry, which in turn points to a valid piece of data.
What are the features of a symbolic link?
- Has a distinct inode.
- Can work across volumes and file systems.
- Is similar to shortcuts in the Windows OS.
- Has a lower-case L (l) as the first character in the permission string. For example, lrwxrwxrwx indicates a symbolic link.
What does the command ln do?
ln creates links to files. With no options, creates hard links.
What does the command ln -s do?
ln -s creates a symbolic link to a file or directory.
What does the command ln -b do?
ln -b creates a backup of a file.
What does the command ln -i do?
ln -i determines the inode for hard or symbolic links.
What does the command cp -l do?
cp -l creates hard links to the files being copied rather than copying the files.
What does the command cp -s do?
cp -s creates symbolic links to the files being copied rather than copying the files.