Intro to Unix

Assignment: File Festival

The purpose of this assignment is to establish, refine, and demonstrate your ability to create subdirectories and manage files in them.

The Assignment

  1. In your home directory, create a set of nested subdirectories that is five levels deep. That is, a subdirectory of your home directory is the first level. Inside this subdirectory should be a subdirectory that is the second level, and so on. Complete this to the fifth level.
  2. In each of the five levels of subdirectories you created in step 1, create an additional number of files equal to the level number. For example, in the level five subdirectory, create five files. In the level four subdirectory, create four files. These files can contain anything. (Note that in the level 4 subdirectory, you will have four files PLUS the level 5 directory (in Unix directories are files).
  3. In your home directory, show the directory structure you have created by using the Unix list command ls -lstR. Here is a small example that I did with three levels (Note that you need to complete five levels.):
    $ ls -lstR
    total 1
       1 drwxr-xr-x   3 december december     1024 Aug 28 11:44 alpha/
    
    alpha:
    total 1
       1 drwxr-xr-x   3 december december     1024 Aug 28 11:44 beta/
       0 -rw-r--r--   1 december december        0 Aug 28 11:44 one
    
    alpha/beta:
    total 1
       1 drwxr-xr-x   2 december december     1024 Aug 28 11:44 gamma/
       0 -rw-r--r--   1 december december        0 Aug 28 11:44 two
       0 -rw-r--r--   1 december december        0 Aug 28 11:44 one
    
    alpha/beta/gamma:
    total 0
       0 -rw-r--r--   1 december december        0 Aug 28 11:44 a
       0 -rw-r--r--   1 december december        0 Aug 28 11:44 b
       0 -rw-r--r--   1 december december        0 Aug 28 11:44 c           
    $ 
    
    Still in your home directory, do the ls -lstR command again, but this time redirect the output of this ls -lstR command to a file. You can call this file anything you'd like.
  4. Now, move all of the files in all of the five levels of subdirectories you created in step 2 to your home directory.
  5. Then delete all the five levels of subdirectories.
  6. In your home directory, use the ls -lstR again to show the new file structure you have. Then append the output of this ls -lstR command to the file you made in step 3.
  7. Your assignment is to email me the contents of the file showing the output of the ls -lstR command in your home directory that you created in step 3 and appended to in step 6.

Turning in Your Assignment

If you are taking this course for credit, please use these procedures for turning in your assignment. Your assignment will be graded according to criteria I set up for this tutorial.

search Search · star Market
2023-06-01 · John December · Terms © johndecember.com