1. n/a 2. Which utility can you use to display the absolute pathname of the working directory? What is the absolute pathname of the working directory? pwd varies depending on your username
3. Change directories so the /tmp directory is the working directory and verify the name of the working directory. cd /tmp pwd 4. What is the quickest way to make your home directory the working directory? Cd 5. n/a
6. Linux does not rely on filenames or filename extensions to determine the type of a file. Use the file utility (Sobell, page 156) to determine the type of the following files.
a. /etc/passwd: ASCII text block special symbolic link symbolic link JPEG image data b. /usr/bin/passwd: executable
c. /var/log: directory
d. /usr/share/man/man1/ls.1.gz: gzip compressed data
e. /dev/tty1: character special
f. /dev/sda: block special
g. /dev/cdrom: symbolic link symbolic link JPEG image data
h. /usr/share/magic: symbolic link
i. /usr/share/pixmaps/faces/sky.png: JPEG image data
7. Text files can be viewed using cat, head, tail, and less (Sobell, pages 148, 152, 153, and 149, respectively). Choose the best application to
a. Display the contents of the /etc/issue file. cat /etc/issue
b. Display the contents of the /etc/sysconfig/network file. cat /etc/sysconfig/network
c. Display the first few lines of the /etc/passwd file. head /etc/passwd
d. Determine the last word in the /usr/share/dict/linux.words file. tail /usr/share/dict/linux.words
e. Display the /etc/profile file. less /etc/profile (Hint: Use q to quit less.)
8. n/a
9. a Which ls option sorts the output by modification time? ls -lt /etc
b. Which head option displays the first 5 lines of a file instead of the default 10 lines? head -n 5 /etc/passwd
c. Which tail option continues to display a file as additional content is added to the file (such as watching a log file)? (Hint: Search for follow.) tail -f /var/log/messages
d. Which cal option displays three months instead of the default current month? cal -3
e. Use whatis to see which man pages relate to passwd. whatis passwd
f. Display the man page for the file named passwd (not the utility). man 5 passwd
g. Use man -k (apropos) to find a utility that shows who is logged in on the system. man -k who
h. Which command reports on free disk space? (Tip: When you want to search for a string with a space, put quotation marks around it: "disk space".) man -k "disk space" df i. The end of the man page for df has a SEE ALSO referencing info. Explore the df info page. info coreutils 'df invocation'
10. n/a