Ch11_Unix.jpg Using the UNIX directory tree shown below, what is the relative pa
ID: 3827011 • Letter: C
Question
Ch11_Unix.jpg
Using the UNIX directory tree shown below, what is the relative path to the localtime file/directory when the working directory is root?
bin etc dev home usr E71 Smith cal ocal time man tty E72 grep profile man1 reports named conf sdn10 sdn11 exit 1.gz week1.txt s.1.gz week2.tx tail 1.gz week3.txt sysconfig man22. man? clock wait 2.gz keyboard wait 2.gz unmask,2.gz umask. 2.gz socket 2.gz socket 2.gz L mail L Ocal ones access bin domain table donations access, old o do txt nslookup schedule host games printall fortune combine Zork sort2Explanation / Answer
Relative path is defined as path related to the present working directory.
However absolute path is the complete path from start of actual filesystem i.e. root directory.
As mentioned in question that present working directory is root itself, so the localtime directory will have relative path as:
etc/localtime
So your present working directory is root. It will look like this:
/
Give command pwd to confirm: pwd
It will show: /
Now if you want to switch to localtime directory using relative path concept,
Type this:
cd etc/localtime
On the other hand, the absolute path to the same directory would be:
/etc/localtime
Now if you want to switch to localtime directory using absolute path concept,
Type this:
cd /etc/localtime
Conclusion:
Relative path: etc/localtime
Absolute path: /etc/localtime