Link Management Flashcards

1
Q

What are symbolic link (symlink) or soft link and its purpose?

A

a pointer to a file or directory.
soft links provide multiple access points to a file or directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

If the source file is deleted or relocated, how does it impact the symbolic link?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How can a symbolic link be removed?

A

unlink <link_name> and rm <link_name>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a broken symbolic link?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can all broken symbolic links in the system be located and displayed in a long list?

A

find / -
xtype l -exec ls -l {} \; find / -type l ! -exec test -e {} \; -print

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the 'unlink' command used for and what is its syntax?

A

unlink <link_name> used to remove the soft link.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can a symbolic link be created? (Exact Syntax)

A

ln -s <original> <link_name>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a hard link and how is it created?

A

hard link is a mirror of the original file. ln <original>
<link_name>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How can hard links be identified?

A

hard links will be highlighted, ls -li will show same inode
number and same time stamp for hard links.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the distinctions between a hard link and a symbolic link?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly