Getting Down with the Unix CLI Lesson 2 Exercise 4

Type each of the following commands at the unix command prompt. Observe the result of each, and apply your new understanding of the file system to make sense of what you see.

  1.   $ mkdir testdir 
      
  2.   $ mkdir testdir/subdir1
      
  3.   $ mkdir testdir/subdir2
      
  4.   $ cd testdir
      
  5. Try to anticipate what you will see before running this command. If you get it right, pat yourself on the back and know that your understanding of both the file system and the new unix commands is growing.

      $ ls
      
  6.   $ cd .. 
      

    What did this do? What is your current working directory now? If you said, my home directory, you're right!

  7.   $ cd testdir
      
  8.   $ mkdir subdir3
      
  9.   $ mkdir subdir1/subsubdir1
      
  10.   $ mkdir subdir3/subsubdir2
      
  11.   $ touch subdir3/subsubdir2/file1.txt
      
  12.   $ touch subdir1/subsubdir1/file2.txt
      
  13.   $ cd .. 
      
  14.   $ tree testdir

    If you followed each step carefully, you should see this in your terminal:

    testdir tree