0
0
Linux CLIscripting~5 mins

cd (change directory) in Linux CLI - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the cd command do in Linux?
The cd command changes the current working directory to another directory you specify.
Click to reveal answer
beginner
How do you go back to your home directory using cd?
Simply type cd without any arguments or cd ~ to return to your home directory.
Click to reveal answer
beginner
What does cd .. do?
It moves you up one directory level, to the parent directory of your current location.
Click to reveal answer
beginner
How can you move to an absolute path using cd?
Type cd followed by the full path starting from root, for example, cd /usr/local/bin.
Click to reveal answer
beginner
What happens if you try cd to a directory that does not exist?
You will get an error message like bash: cd: directory: No such file or directory.
Click to reveal answer
What command takes you to the parent directory?
Acd ~
Bcd /
Ccd ..
Dcd -
How do you return to your home directory quickly?
Acd ~
Bcd ..
Ccd /home
Dcd /root
Which command changes directory to an absolute path?
Acd folder
Bcd /usr/bin
Ccd ../folder
Dcd ~
What does cd - do?
AGoes to the root directory
BGoes to the parent directory
CGoes to the home directory
DGoes to the previous directory you were in
If you type cd unknown and the directory does not exist, what happens?
AYou stay in the current directory and get an error
BYou move to the root directory
CYou create the directory automatically
DYou move to the home directory
Explain how to navigate to your home directory and then move up one level using cd commands.
Think about what <code>cd</code> alone does and what <code>..</code> means.
You got /4 concepts.
    Describe the difference between using a relative path and an absolute path with the cd command.
    Consider paths starting with <code>/</code> versus those that don't.
    You got /4 concepts.