If you can see this check that

Main Page

Basic paths


Essentials

User:
Password:

Basic Paths

This tutorial covers the basics of relative and absolute paths. Use the Caine virtual machine.

To reset all the check buttons from a previous attempt click here

Question 1: Relative and Absolute

Demonstrate your understanding of relative, absolute, and the use of ".." and "/" and "." in the "cd" command by answering these questions. Try to answer them in your own head, and use the command line only if you are confused. Remember paths beginning with "/" are relative to the top level directory, whereas others are relative to the current directory. ".." takes you up a directory, and things can be seperated with "/" such as "../.." taking you up 2 directories. "." indicates the current directory, and is really only useful where you really need to specify a parameter but you mean to say the current directory. Always supply the SHORTEST solution, remember the answers are CASE SENSITIVE, and if you type spaces in an answerbox where no space should be entered then it will be marked incorrectly.

Consider these commands:

cd /usr/share/doc
cd ..
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands:

cd /usr/share
cd vim
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands:

cd /usr
cd lib
cd xorg
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands:

cd
cd ../.. 
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands:

cd
cd ../caine
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands:

cd /usr/share
cd vim/../../lib/xorg
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands:

cd /usr/share
cd /etc/vim
cd ..
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands:

cd 
cd ../../usr/share/doc
pwd
What is the current directory:

Tests - not attempted
Correct cwd UNTESTED

Consider these commands and fill in the blank:

cd
cd ../
pwd
Where the "pwd" command prints "/usr/local/lib".
Note this is an example of a RELATIVE pathname parameter to cd, as the parameter does not start with a "/".

Tests - not attempted
Correct blank UNTESTED

Consider these commands and fill in the blank:

cd /usr/share/doc
cd /
cd caine
pwd
Where the "pwd" command prints "/home/caine"
Note this is an example of an ABSOLUTE pathname parameter to cd, as the parameter starts with a "/".

Tests - not attempted
Correct cwd UNTESTED

Consider these commands and fill in the correct blank using a RELATIVE pathname. It should be the SHORTEST possible solution.

cd /usr/share/python
cd 
pwd
Where the "pwd" command prints "/usr/share/perl5/Encode".

Tests - not attempted
Correct cwd UNTESTED

Consider these commands and fill in the correct blank using a RELATIVE pathname. It should be the SHORTEST possible solution.

cd /usr/share/perl
cd 
pwd
Where the "pwd" command prints "/etc"

Tests - not attempted
Correct cwd UNTESTED

Consider these commands and fill in the correct blank using a RELATIVE pathname. It should be the SHORTEST possible solution.

cd /etc
cd 
pwd
Where the "pwd" command prints "/etc"

Tests - not attempted
Correct cwd UNTESTED


Centos 7 intro: Paths | BasicShell | Search
Linux tutorials: intro1 intro2 wildcard permission pipe vi essential admin net SELinux1 SELinux2 fwall DNS diag Apache1 Apache2 log Mail
Caine 10.0: Essentials | Basic | Search | Acquisition | SysIntro | grep | MBR | GPT | FAT | NTFS | FRMeta | FRTools | Browser | Mock Exam |
Caine 13.0: Essentials | Basic | Search | Acquisition | SysIntro | grep | MBR | GPT | FAT | NTFS | FRMeta | FRTools | Browser | Mock Exam |
CPD: Cygwin | Paths | Files and head/tail | Find and regex | Sort | Log Analysis
Kali: 1a | 1b | 1c | 2 | 3 | 4a | 4b | 5 | 6 | 7a | 8a | 8b | 9 | 10 |
Kali 2020-4: 1a | 1b | 1c | 2 | 3 | 4a | 4b | 5 | 6 | 7 | 8a | 8b | 9 | 10 |
Useful: Quiz | Forums | Privacy Policy | Terms and Conditions

Linuxzoo created by Gordon Russell.
@ Copyright 2004-2024 Edinburgh Napier University