

Linux File Management Basics

  • Print
  • + Share This
This chapter is from the book

This chapter covers the following topics:

  • Filesystem Overview
  • File Management Commands
  • Where Are Those Files?
  • Backup Commands

This chapter covers the following objectives:

  • Perform basic file management: 103.3
  • Create and change hard and symbolic links: 104.6
  • Find system files and place files in the correct location: 104.7

Most of what you do on a Linux machine involves manipulating files in some manner. You have to know where certain files go, such as binaries, configuration, and user data. You also need to be able to manipulate files from the command line rather than a GUI.

“Do I Know This Already?” Quiz

The “Do I Know This Already?” quiz enables you to assess whether you should read this entire chapter or simply jump to the “Exam Preparation Tasks” section for review. If you are in doubt, read the entire chapter. Table 5-1 outlines the major headings in this chapter and the corresponding “Do I Know This Already?” quiz questions. You can find the answers in Appendix A, “Answers to the ‘Do I Know This Already?’ Quizzes and Review Questions.”


Foundation Topics Section

Questions Covered in This Section

Filesystem Overview

1, 3

File Management Commands

2, 4-6

Where Are Those Files?


Backup Commands


  1. Files that change often should go under:

    1. /usr
    2. /proc
    3. /root
    4. /var
  2. Your shell is in /usr/local. You type cd ../bin. Which directory is shown when you type pwd?

    1. /bin
    2. /usr/bin
    3. /usr/local/bin
    4. Nothing, this command returns an error.
  3. Which of the following directories should be on the same partition as the root?

    1. /boot
    2. /usr
    3. /home
    4. /sbin
  4. You happen across a file in a directory called foo. What is a good way to find out what the file is or does?

    1. file foo
    2. /foo
    3. cat foo
    4. which foo
  5. What command would be used to update the date on a file?

    1. tar
    2. file
    3. date
    4. touch
  6. You are trying to create a new series of nested directories: /a/b/c/d/. What is the fastest way to create this nested directory set?

    1. mkdir /a; mkdir /a/b; mkdir /a/b/c; mkdir /a/b/c/d
    2. mkdir /a/b/c/d
    3. mkdir -p /a/b/c/d
    4. md /a/b/c/d
  7. You know that you have multiple copies of the doit command on your system. How do you find which one you will run if you type doit at the command line?

    1. whereis doit
    2. locate doit
    3. find doit
    4. which doit
  8. You know that you downloaded a file called backup.tar.gz this morning but can’t remember where you put it. Which is the most appropriate command to find the file?

    1. find / -name backup.tar.gz
    2. find backup.tar.gz
    3. locate backup.tar.gz
    4. whereis backup.tar.gz
  9. You want to package up Fred’s home directory on a USB stick to send with him as he’s leaving your company. Which command is the best? Hurry, because there’s cake!

    1. find /home/fred | tar -czf > /media/removable/fred.tar.gz
    2. tar -czf /home/fred > /media/removable/fred.tar.gz
    3. cd /home/; tar -cjf /media/removable/fred.tar.bz2 fred
    4. cd /home/fred tar -cjf /media/removable/fred.tar.bz2 *
  10. What does the command tar -tf archive.tar etc/pine.conf do?

    1. Makes a new archive called archive.tar containing /etc/pine.conf
    2. Adds etc/pine.conf to archive.tar
    3. Checks to see whether etc/pine.conf is inside the archive
    4. Extracts etc/pine.conf from archive.tar
  11. Which compression utility offers the highest level of compression?

    1. bzip2
    2. gzip
    3. compress
    4. cpio
  • + Share This
  • 🔖 Save To Your Account