Link Management Flashcards
What are symbolic link (symlink) or soft link and its purpose?
a pointer to a file or directory.
soft links provide multiple access points to a file or directory
If the source file is deleted or relocated, how does it impact the symbolic link?
the soft link is
broken so we cannot access the content. pointing to a non-existent file or directory. A broken symlink is a soft link that points to a file or directory that no longer exists.
How can a symbolic link be removed?
unlink <link_name> and rm <link_name>
What is a broken symbolic link?
if the original/source file is removed/deleted or moved to
another location, then soft link is broken. pointing to a non-existent file or directory
How can all broken symbolic links in the system be located and displayed in a long list?
find / -
xtype l -exec ls -l {} \; find / -type l ! -exec test -e {} \; -print
What is the 'unlink' command used for and what is its syntax?
unlink <link_name> used to remove the soft link.
How can a symbolic link be created? (Exact Syntax)
ln -s <original> <link_name>
What is a hard link and how is it created?
hard link is a mirror of the original file. ln <original>
<link_name>
How can hard links be identified?
hard links will be highlighted, ls -li will show same inode
number and same time stamp for hard links.
What are the distinctions between a hard link and a symbolic link?
soft – pointers to a file or directory, different inode numbers, link broken if original is removed, for directories too, cross partition.
hard links – mirror images, same inode number, link is unaffected if original is removed, not for directories, cannot be created cross partition, have to be on the same partition. Hard links cannot be created cross partition since they have the same inode number as the original file.