Where Am I?
When working in the terminal, you are always inside a specific directory. This is known as the Current Working Directory.
The pwd Command
pwd stands for Print Working Directory. It displays the full, absolute path of the directory you are currently in.
Example:
- Open the terminal.
- Type
pwd.
bash $ pwd /home/yourusername
This output confirms you are in your user's home directory. Note that the path starts at the root (/).
Absolute vs. Relative Paths
- Absolute Path: The full path starting from the root directory (
/). Example:/etc/ssh/sshd_config. - Relative Path: A path defined relative to your current working directory. Example: If you are in
/home/user, the pathDocuments/reports.txtrefers to/home/user/Documents/reports.txt.