UP | HOME

HW3
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

  1. ssh into eustis:

    ssh NID@eustis.eecs.ucf.edu
    
  2. Download the file tree for the exercise:

    wget -O ~/hw3.tar 'https://www.cs.ucf.edu/~gazzillo/teaching/cop3402fall24/files/hw3.tar'
    
  3. Untar the file tree:

    tar -C ~/ -xvf ~/hw3.tar
    
  4. Enter the file tree:

    cd ~/hw3
    
  5. The file tree should look like the following when typing tree ~/hw3

    .
    ├── drivers
    ├── fs
    │   └── ext2
    │       └── acl.c
    ├── hid
    │   ├── bpf
    │   │   └── Makefile
    │   ├── i2c-hid
    │   │   └── Makefile
    │   └── usbhid
    │       └── Makefile
    ├── Makefile
    └── net
        └── ethernet
    
  6. 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
    
  7. Submit the sequence of bash commands as your homework.

Important notes

  • 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 after drivers/ 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 hw3 version away, and unpack the example again:

    cd ~
    rm -r ~/hw3
    tar -C ~/ -xvf ~/hw3.tar
    cd ~/hw3
    
  • 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

Author: Paul Gazzillo

Created: 2024-08-28 Wed 10:55

Validate