Table of Contents

File Management Practice

Exercise 1

Purpose: To practice creating directories, copying files between directories, and moving files between directories on a Linux system.

Perform these steps on Matrix or another Linux system:

  1. Create a directory in which to practice (for example, “file-practice”) using the mkdir command.
  2. Change to that directory using the cd command.
  3. Create these directories:
    • portable-document-format
    • open-document-text
    • january
    • february
    • march
    • april
  4. Create these files (they can be empty files):
    • january.pdf
    • january.odt
    • february.pdf
    • february.odt
    • march.pdf
    • march.odt
    • april.pdf
    • april.odt
  5. Make a copy of each of the PDF files in the portable-document-format directory using a single command. Use the cp command with a filename pattern.
  6. Make a copy of all of the ODT files in the open-document-text directory using a single command.
  7. Move (don't copy) all of the files related to January into the january directory using a single command.
  8. Repeat the previous step for February, March, and April.
  9. Use the tree command to verify your result. It should look like this:
.
├── april
│   ├── april.odt
│   └── april.pdf
├── february
│   ├── february.odt
│   └── february.pdf
├── january
│   ├── january.odt
│   └── january.pdf
├── march
│   ├── march.odt
│   └── march.pdf
├── open-document-text
│   ├── april.odt
│   ├── february.odt
│   ├── january.odt
│   └── march.odt
└── portable-document-format
    ├── april.pdf
    ├── february.pdf
    ├── january.pdf
    └── march.pdf

Exercise 2

Purpose: To practice creating directories, copying files between directories, and moving files between directories on a Windows system.

Perform these steps on a Windows system:

  1. Create a directory in which to practice (for example, “file-practice”) using the mkdir command.
  2. Change to that directory using the cd command.
  3. Create these directories:
    • portable-document-format
    • open-document-text
    • january
    • february
    • march
    • april
  4. Create these files (they can be empty files):
    • january.pdf
    • january.odt
    • february.pdf
    • february.odt
    • march.pdf
    • march.odt
    • april.pdf
    • april.odt
  5. Make a copy of all of the PDF files in the portable-document-format directory using a single command. Use the copy command with a filename pattern.
  6. Make a copy of all of the ODT files in the open-document-text directory using a single command.
  7. Move (don't copy) all of the files related to January into the january directory using a single command.
  8. Repeat the previous step for February, March, and April.
  9. Use the tree /f command to verify your work. The output should look like this:
Folder PATH listing
Volume serial number is FC3B-8615
C:.
├───april
│       april.odt
│       april.pdf
│
├───february
│       february.odt
│       february.pdf
│
├───january
│       january.odt
│       january.pdf
│
├───march
│       march.odt
│       march.pdf
│
├───open-document-text
│       april.odt
│       february.odt
│       january.odt
│       march.odt
│
└───portable-document-format
        april.pdf
        february.pdf
        january.pdf
        march.pdf