Change directory
This page was last updated on October 10, 2013.
It’s not recommended to use special meta-characters (like *, ?, $, &, brackets, etc.) in file names or directory names because they have special meaning to the Linux shell.
Go home
- Type this command in a terminal window, replacing username with your user name:
cd /home/username
Or type this command in a terminal window:
cd ~
Or type this command in a terminal window:
cd
- Press the Enter key.
Change to a directory up one level
- Type this command in a terminal window:
cd ..
- Press the Enter key.
Change to the previous directory
- Type this command in a terminal window:
cd -
- Press the Enter key.
Change to a directory with spaces in its name
- Type this command in a terminal window, replacing My\ Stuff with the name of your directory with backslashes before each space:
cd My\ Stuff
Or type this command in a terminal window, replacing My Stuff with the name of your directory:
cd "My Stuff"
Or type this command in a terminal window, replacing My with the first word of your directory name:
cd My*
- Press the Enter key.
Obligatory Happy Ending
And they all lived happily ever after. The end.

Comment: