Assessment: Relative paths, absolute paths, and the home directory

Oct 2, 2014 • Lauren Michael

Pertaining to the Files and Directories section of Unix Shell.

 

Question 1

From a user’s home directory of /home/user, “/” represents ____ , and “..” represents ______.

A)  the top or “root” of the filesystem; the present working directory
B)  a relative path; a relative path
C)  an absolute path; the present working directory
D)  an absolute path; a relative path

 

Question 2

For a hypothetical filesystem location of /home/amanda/data/, select each of the below commands that Amanda could use to navigate to her home directory, which is /home/amanda .

1)  cd .
2)  cd /
3)  cd /home/amanda
4)  cd ../..
5)  cd ~
6)  cd home
7)  cd ~/data/..
8)  cd
9)  cd ..

 

Update — Answers

Q1) D

Q2) 3, 5, 7, 8*, 9
*Answer 8 may be environment-specific