Command Line Navigation Flashcards
6 cards from real 010-160 practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 6 Command Line Navigation flashcards as text
A user is currently in the `/home/user/documents` directory. Which of the following commands will change the current directory to the `/home/user` directory?
Answer: cd ..
The `..` represents the parent directory. From `/home/user/documents`, the parent directory is `/home/user`. Therefore, `cd ..` will navigate one level up to the desired directory.
Which command is used to display the full path of the current working directory?
Answer: pwd
The `pwd` command stands for 'print working directory' and its function is to display the absolute path of the directory you are currently in.
A user wants to navigate to their home directory, regardless of their current location in the filesystem. Which is the most efficient command to achieve this?
Answer: cd
Typing `cd` without any arguments, or using `cd ~`, will always take you to your home directory. This is the most direct and universally applicable method.
What is the key difference between an absolute path and a relative path?
Answer: An absolute path is valid from anywhere in the filesystem, while a relative path depends on the current directory.
An absolute path specifies a location from the root directory (`/`) and is unambiguous. A relative path specifies a location starting from the current directory, so its meaning changes depending on where you are.
After navigating from `/usr/share` to `/etc/systemd`, which command will take you back to `/usr/share`?
Answer: cd -
The `cd -` command is a special shortcut that changes the current directory to the previous working directory. It effectively toggles between the two most recent directories.
You are in a directory `/var/log`. You want to list the contents of the `apt` subdirectory within `/var/log`. Which command, using a relative path, would you use?
Answer: ls apt
Since you are already in `/var/log`, you can use a relative path. The command `ls apt` will list the contents of the `apt` directory, which is located within your current directory.