0
0
Linux CLIscripting~5 mins

Home directory (~) and shortcuts in Linux CLI - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the tilde (~) symbol represent in the Linux command line?
The tilde (~) symbol is a shortcut that represents the current user's home directory. For example, cd ~ takes you to your home folder.
Click to reveal answer
beginner
How can you quickly go to the home directory from anywhere in the terminal?
You can type cd ~ or simply cd without any arguments to go directly to your home directory.
Click to reveal answer
intermediate
What is the difference between ~ and ~/ in Linux commands?
~ refers to the home directory itself, while ~/ refers to the home directory followed by a slash, which is used to specify files or folders inside the home directory. For example, ~/Documents means the Documents folder inside your home.
Click to reveal answer
intermediate
What shortcut can you use to refer to the previous directory you were in?
You can use cd - to switch back to the last directory you were in before the current one. It acts like a toggle between two folders.
Click to reveal answer
beginner
How do you use shortcuts to refer to the root directory and the current directory?
The root directory is represented by /. The current directory is represented by .. For example, cd / goes to root, and ./script.sh runs a script in the current folder.
Click to reveal answer
What does the command cd ~ do?
ADeletes the home directory
BTakes you to the root directory
CLists files in the current directory
DTakes you to your home directory
Which command switches you back to the previous directory you were in?
Acd -
Bcd ..
Ccd ~
Dcd /
What does ~/Documents mean?
ADocuments folder inside the home directory
BDocuments folder inside the root directory
CA hidden folder named Documents
DThe current directory
What does the dot (.) represent in Linux paths?
AHome directory
BRoot directory
CCurrent directory
DParent directory
What happens if you type cd with no arguments?
AIt shows an error
BIt goes to the home directory
CIt goes to the root directory
DIt stays in the current directory
Explain how the tilde (~) shortcut helps you navigate in the Linux terminal.
Think about where you usually start when opening a terminal.
You got /4 concepts.
    Describe the difference between the shortcuts ~, ., and / in Linux paths.
    Consider the folder hierarchy and your position in it.
    You got /4 concepts.