HW2
COP-3402
Table of Contents
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, ls). Submit the exact sequence of bash commands used. Remember to use tab-completion to make using the command-line easier.
Directions
ssh into eustis:
ssh NID@eustis.eecs.ucf.edu
Download the file tree for the exercise:
wget -O ~/hw2.tar 'https://www.cs.ucf.edu/~gazzillo/teaching/cop3402spring25/files/hw2.tar'
Untar 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 ~/hw2
You only need these commands to perform the changes
Command Description touch create file rm ReMove mv MoVe cp CoPy mkdir MaKe DIRectory rmdir ReMove (an empty) DIRectory