pwd
The command that prints the full path of the current working directory.
In more detail
Its name stands for print working directory, and it shows exactly where relative paths will be looked up. Bash keeps the answer in the PWD variable too, which is how prompts show your location without running a command. In Windows Command Prompt, cd with no argument does the same job.
Related terms
- current working directory — The directory a shell or process is standing in, where any relative path or bare file name is looked up.
- cd — The builtin that changes the shell's current working directory.
- absolute path — A path that starts from the top of the file system, such as /home/ana/notes.txt or C:\Users\ana\notes.txt, and so works from anywhere.
- ls — The command that lists the files and directories inside a directory.
Taught in
- Moving Around: pwd, ls, cd And Paths — Bash Scripting & Command Line Automation
- Command Substitution And Subshells — Bash Scripting & Command Line Automation
- Style That Prevents Bugs — Bash Scripting & Command Line Automation
- Windows And Mac Specifics — Hands-on Python: Complete Video Course & Book
- Variables, The PATH And The History — LPIC-1 Linux Administrator (101-500 and 102-500) Exam Prep