Making, Deleting and Changing Directories

To keep our files organised, we need to be able to make and delete directories. We also need to be able to change working directory as required. Note that commands in Unix and DOS are similar but not the same. In either operating system, the tree command gives a nice overview of the directory tree structure from the working directory down.

The command cd directoryname changes the working directory.

The command mkdir subdirectory makes a new directory.

The command rmdir subdirectory removes a sub directory.

Exercise

Go to you home directory.

  1. Create a directory called CLI

  2. Change your working directory to CLI

  3. Create a directory called Backup under the directory CLI

  4. Create a directory called Test under the directory CLI

  5. Return to your home directory by typing cd. You will often see cd~ used, it has the same effect.

  6. Use the tree command to review what you have done.

  7. Delete the directory called Test, you may have to navigate to it!

  8. Check the result of the command cd ..

  9. In either operating system, cd / should bring you back to the root.