HW2
In this exercise, you will restructure one file tree into another,
using any of the Unix utilities shown in class (cp,
mv, mkdir, rmdir,
touch, and ls). Submit the exact sequence of
bash commands used. Remember to use tab-completion to make using the
command-line easier.
Directions
sshinto eustis:
ssh NID@eustis.eecs.ucf.edu- Download the file tree for the exercise:
wget -O ~/hw2.tar 'https://www.cs.ucf.edu/~pappas/teaching/cop3402/fal2026/files/hw2.tar'- Extract the file tree:
tar -C ~/ -xvf ~/hw2.tar- Enter the file tree:
cd ~/hw2
- The file tree should look like the following when typing
tree ~/hw2
.
├── drivers
├── fs
│ └── ext2
│ └── acl.c
├── hid
│ ├── bpf
│ │ └── Makefile
│ ├── i2c-hid
│ │ └── Makefile
│ └── usbhid
│ └── Makefile
├── Makefile
└── net
└── ethernet- Now find a sequence of commands that restructures the tree into the following one:
.
├── drivers
│ ├── hid
│ │ ├── bpf
│ │ │ └── Makefile
│ │ ├── i2c-hid
│ │ │ └── Makefile
│ │ └── usbhid
│ │ └── Makefile
│ └── Makefile
├── fs
│ └── ext4
│ └── acl.c
├── Makefile
├── net
└── sound- Submit the sequence of bash commands as your homework.
Important notes
New files may be files or directories.
There are many ways (sequences of commands) to solve the problem.
The entries (children) in a directory are unordered. For instance, if
fs/is before or afterdrivers/that is okay. The file system guarantees tree structure, i.e., parent-child relationships, but not ordering of entries in a directory.If you need to start over, go back home, move your prior hw2 version away, and unpack the example again:
cd ~ rm -r ~/hw2 tar -C ~/ -xvf ~/hw2.tar cd ~/hw2You only need these commands to perform the changes
Command Description touchcreate file rmReMove mvMoVe cpCoPy mkdirMaKe DIRectory rmdirReMove (an empty) DIRectory