ops102:file_management_practice
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:
- Create a directory in which to practice (for example, “file-practice”) using the
mkdircommand. - Change to that directory using the
cdcommand. - Create these directories:
- portable-document-format
- open-document-text
- january
- february
- march
- april
- Create these files (they can be empty files):
- january.pdf
- january.odt
- february.pdf
- february.odt
- march.pdf
- march.odt
- april.pdf
- april.odt
- Make a copy of each of the PDF files in the
portable-document-formatdirectory using a single command. Use thecpcommand with a filename pattern. - Make a copy of all of the ODT files in the
open-document-textdirectory using a single command. - Move (don't copy) all of the files related to January into the
januarydirectory using a single command. - Repeat the previous step for February, March, and April.
- Use the
treecommand 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:
- Create a directory in which to practice (for example, “file-practice”) using the
mkdircommand. - Change to that directory using the
cdcommand. - Create these directories:
- portable-document-format
- open-document-text
- january
- february
- march
- april
- Create these files (they can be empty files):
- january.pdf
- january.odt
- february.pdf
- february.odt
- march.pdf
- march.odt
- april.pdf
- april.odt
- Make a copy of all of the PDF files in the
portable-document-formatdirectory using a single command. Use thecopycommand with a filename pattern. - Make a copy of all of the ODT files in the
open-document-textdirectory using a single command. - Move (don't copy) all of the files related to January into the
januarydirectory using a single command. - Repeat the previous step for February, March, and April.
- Use the
tree /fcommand 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
ops102/file_management_practice.txt · Last modified: 2024/04/16 18:10 by 127.0.0.1
