Hour 4

1: Which of the following are absolute pathnames? Which are relative?
  1. /usr/local/bin

  2. ../../home/ranga

  3. docs/book/ch01

  4. /

A1: (a) and (d) are absolute pathnames. (b) and (c) are relative pathnames.
2: What is the output of the pwd command after the following sequence of cd commands have been issued?
$ cd /usr/local
$ cd bin
$ cd ../../tmp
$ cd
A2: The pwd command will output the full path to your home directory.
3: What command should be used to copy the directory /usr/local to /opt/pgms?
A3: The following command will work:
cp -r /usr/local /opt/pgms
4: What command(s) should be used to move the directory /usr/local to /opt/pgms?
A4: The following commands will work:
cp -r /usr/local /opt/pgms ; rm -r /usr/local
5: Given the following listing ...

Get Sams Teach Yourself Shell Programming in 24 Hours, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.