0
0
Linux CLIscripting~5 mins

pwd (print working directory) in Linux CLI - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the pwd command do in Linux?
The pwd command shows the full path of the current directory you are in. It tells you exactly where you are in the folder structure.
Click to reveal answer
beginner
How can pwd help when you feel lost in the terminal?
If you don't know which folder you are working in, running pwd will print your current location. This helps you avoid mistakes like creating files in the wrong place.
Click to reveal answer
beginner
True or False: pwd changes your current directory.
False. pwd only shows your current directory path. It does not move you to another directory.
Click to reveal answer
beginner
What is the typical output format of pwd?
It outputs an absolute path starting with a slash /, like /home/username/Documents. This path shows the full route from the root folder to your current folder.
Click to reveal answer
intermediate
Can pwd be used in scripts? Why?
Yes, pwd is often used in scripts to get the current directory path. This helps scripts know where they are running and manage files correctly.
Click to reveal answer
What does the pwd command display?
AList of files in the directory
BThe current user's name
CThe system's hostname
DThe current directory's full path
If you run pwd and see /home/user, where are you?
AIn the user's home directory
BIn the temporary files folder
CIn the system's bin folder
DIn the root directory
Does pwd change your location in the terminal?
AYes, it moves you to the root directory
BNo, it only shows your current directory
CYes, it moves you to the home directory
DNo, it lists files in the directory
Which symbol usually starts the output of pwd?
A~
B#
C/
D$
Why might a script use pwd?
ATo find out the current directory path
BTo list all files
CTo change the directory
DTo delete files
Explain what the pwd command does and why it is useful.
Think about how you find your location on a map.
You got /3 concepts.
    Describe a situation where using pwd in a script would be helpful.
    Imagine a script saving files and needing to know where to put them.
    You got /3 concepts.