This is an introductory guide to UNIX for Macquarie University computing students, written by Mary Gardiner in 2004. It is no longer being updated but is available for modification and republication under the Creative Commons Attribution licence.

UNIX Guide · Working with directories

UNIX: Working with directories

Directories are often also called folders.

Changing directories

The cd command changes directories.


Change to a directory named dir
cd dir
Change to the parent directory
cd ..
Change to your home directory

Present directory

To find out the name of the directory you're currently in, use the command pwd.

Creating a directory

Use the command mkdir to make a new directory. For example, use mkdir dir to make a directory called dir.

Deleting a directory

Use the command rmdir to delete a new directory. For example, use rmdir dir to delete a directory called dir.

A directory won't be deleted unless it is empty.