Problem

In this hands-on project, you create, view, and extract archives using the tar utility....

In this hands-on project, you create, view, and extract archives using the tar utility.

1. Switch to a command-line terminal (tty2) by pressing Ctrl+Alt+F2 and log in to the terminal using the user name of root and the password of secret.

2. At the command prompt, type tar –cvf test1.tar /etc/samba and press Enter to create an archive called test1.tar in the current directory that contains the /etc/samba directory and its contents. Next, type ls –l at the command prompt and press Enter. How large is the test1.tar file?

3. At the command prompt, type tar –tvf test1.tar and press Enter. What is displayed?

4. At the command prompt, type mkdir /new1 and press Enter. Next, type cd /new1 at the command prompt and press Enter to change the current directory to the /new1 directory.

5. At the command prompt, type tar –xvf /root/test1.tar and press Enter to extract the contents of the test1.tar archive. Next, type ls –F at the command prompt and press Enter to view the contents of the /new1 directory. Was the extraction successful?

6. At the command prompt, type cd and press Enter to return to your home directory.

7. At the command prompt, type tar –zcvf test2.tar.gz /etc/samba and press Enter to create a gzip-compressed archive called test2.tar.gz in the current directory that contains the /etc/samba directory and its contents. Next, type ls –l at the command prompt and press Enter. How large is the test2.tar.gz file? How does this compare with the size obtained for test1.tar in Step 2? Why?

8. At the command prompt, type tar –ztvf test2.tar.gz and press Enter. What is displayed?

9. At the command prompt, type mkdir /new2 and press Enter. Next, type cd /new2 at the command prompt and press Enter to change the current directory to the /new2 directory.

10. At the command prompt, type tar –zxvf /root/test2.tar.gz and press Enter to uncompress and extract the contents of the test2.tar.gz archive. Next, type ls –F at the command prompt and press Enter to view the contents of the /new2 directory. Was the extraction successful?

11. At the command prompt, type cd and press Enter to return to your home directory.

12. Insert a floppy disk into the floppy disk drive of your computer, type modprobe floppy at the command prompt, and press Enter.

13. At the command prompt, type tar –cvf /dev/fd0 /etc/samba and press Enter to create an archive on the device /dev/fd0 that contains the /etc/samba directory and its contents.

14. At the command prompt, type tar –tvf /dev/fd0 and press Enter. What is displayed?

15. At the command prompt, type mkdir /new3 and press Enter. Next, type cd /new3 at the command prompt and press Enter to change the current directory to the /new3 directory.

16. At the command prompt, type tar –xvf /dev/fd0 and press Enter to extract the contents of the archive stored on the first floppy disk. Next, type ls –F at the command prompt and press Enter to view the contents of the /new3 directory. Was the extraction successful?

17. At the command prompt, type mount /dev/fd0 and press Enter to mount the floppy from the appropriate entry in /etc/fstab. What error message do you receive and why? Why was the filesystem type not automatically detected? Can this floppy be mounted?

18. At the command prompt, type rm –Rf /new[123] and press Enter to remove the directories created in this hands-on project.

19. At the command prompt, type rm –f /root/test* and press Enter to remove the tar archives created in this hands-on project.

20. Remove the floppy disk from your floppy disk drive, type exit, and press Enter to log out of your shell.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 11