0
0
Linux CLIscripting~10 mins

Absolute vs relative paths in Linux CLI - Interactive Practice

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

Complete the command to list files using an absolute path.

Linux CLI
ls [1]
Drag options to blanks, or click blank then click option'
A../documents
B/home/user/documents
C./documents
Ddocuments
Attempts:
3 left
💡 Hint
Common Mistakes
Using relative paths when an absolute path is required.
Not starting absolute paths with '/'.
2fill in blank
medium

Complete the command to change directory to a relative path.

Linux CLI
cd [1]
Drag options to blanks, or click blank then click option'
A/var/log
B/logs
Clogs
D/var
Attempts:
3 left
💡 Hint
Common Mistakes
Using absolute paths when a relative path is expected.
Starting relative paths with '/'.
3fill in blank
hard

Fix the error in the command to copy a file using an absolute path.

Linux CLI
cp [1] /backup/
Drag options to blanks, or click blank then click option'
Ahome/user/file.txt
B./file.txt
Cfile.txt
D/home/user/file.txt
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the leading '/' in absolute paths.
Using relative paths when absolute paths are needed.
4fill in blank
hard

Fill both blanks to create a relative path command to move up one directory and then into 'projects'.

Linux CLI
cd [1]/[2]
Drag options to blanks, or click blank then click option'
A..
Bprojects
C.
D/projects
Attempts:
3 left
💡 Hint
Common Mistakes
Using '.' instead of '..' to move up.
Using absolute path '/projects' instead of relative.
5fill in blank
hard

Fill all three blanks to create a command that lists files in the documents folder inside the user's home directory using an absolute path.

Linux CLI
ls [1]/[2]/[3]
Drag options to blanks, or click blank then click option'
A/home
Buser
Cdocuments
Ddownloads
Attempts:
3 left
💡 Hint
Common Mistakes
Using relative paths instead of absolute.
Mixing up folder order in the path.