Changing Directories with cd

Use the cd command to move within the file system from one directory to another. It might help you remember this command to think of it meaning “change directory.” The most basic usage of cd is this:

matthew@seymour:~$ cd somedir

That looks in the current directory for the somedir subdirectory, and then moves you into it. You can also specify an exact location for a directory, like this:

matthew@seymour:~$ cd /home/matthew/stuff/somedir

You can also use the cd command with several shortcuts. For example, to quickly move up to the parent directory, the one above the one you are currently in, use the cd command like this:

matthew@seymour:~$ cd ..

To return to your home directory from anywhere ...

Get Ubuntu Unleashed 2015 Edition: Covering 14.10 and 15.04, Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.