0
0
Linux CLIscripting~10 mins

ln (hard and symbolic links) in Linux CLI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a hard link named 'linkfile' to 'originalfile'.

Linux CLI
ln [1] originalfile linkfile
Drag options to blanks, or click blank then click option'
A-s
B(no option)
C-h
D-f
Attempts:
3 left
💡 Hint
Common Mistakes
Using -s option creates a symbolic link instead of a hard link.
Using -h is not a valid option for ln.
2fill in blank
medium

Complete the code to create a symbolic link named 'symblink' to 'targetfile'.

Linux CLI
ln [1] targetfile symblink
Drag options to blanks, or click blank then click option'
A-s
B-f
C-h
D-l
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the -s option creates a hard link instead.
Using -l is not a valid option for ln.
3fill in blank
hard

Fix the error in the command to create a symbolic link named 'link' to 'file.txt'.

Linux CLI
ln [1] file.txt link
Drag options to blanks, or click blank then click option'
A-s
B-h
C-f
D--symbolic
Attempts:
3 left
💡 Hint
Common Mistakes
Using -h instead of -s.
Omitting the option creates a hard link.
4fill in blank
hard

Fill both blanks to create a symbolic link named 'link' pointing to 'file.txt' and force overwrite if 'link' exists.

Linux CLI
ln [1] [2] file.txt link
Drag options to blanks, or click blank then click option'
A-s
B-f
C-h
D-l
Attempts:
3 left
💡 Hint
Common Mistakes
Using -h which is invalid.
Forgetting to use -f to overwrite existing links.
5fill in blank
hard

Fill all three blanks to create a hard link named 'hardlink' to 'data.txt' and then list the links with inode numbers.

Linux CLI
ln [1] data.txt hardlink && ls -i [2] [3]
Drag options to blanks, or click blank then click option'
A(no option)
Bdata.txt
Chardlink
D-s
Attempts:
3 left
💡 Hint
Common Mistakes
Using -s option creates symbolic link instead of hard link.
Listing only one file does not show inode comparison.