Lesson 4 of 23
Lesson Progress: 0%
The pwdcommand stands for "print working directory" and is one of the simplest yet most useful commands in the Linux shell. When you run it, the shell displays the full absolute path of the directory you are currently in. This is especially helpful when you are navigating through folders and lose track of where you are. Unlike other commands that take flags or arguments, pwd is typically used by itself and always returns a single line: the path to your current location. Learning to use pwd regularly will help you stay oriented in the filesystem and build confidence as you explore new directories.
pwd prints the full path of your current working directory, starting from the root /.pwd shows that location.pwd is the quickest way to figure out where you are.pwd now to see what directory you are currently in.Documents instead of your home folder.pwd here shows /home/user/Documents, the full path that includes every directory from root down to your current folder./ is one level in the directory tree.cd move changes what pwd reports.pwd to confirm that you are indeed inside the Documents folder./tmp directory, a common location for temporary files./tmp directory is one level below root, so its absolute path is short — just /tmp.pwd will reveal.pwd to see that you are now in /tmp./var, another standard system directory./var, /etc, and /tmp are all part of the Linux filesystem hierarchy.pwd in different system folders helps you learn the standard layout of a Linux system.pwd command works exactly the same way in every directory — it always prints the absolute path.pwd to see that your current directory is /var./etc, a directory that holds system configuration files./etc), it is still a complete absolute path starting from root./etc are located helps you become a more confident Linux user.pwd output is always predictable and reliable — you can trust it to tell you exactly where you are.pwd to verify you are in /etc./home/user/Downloads, a subfolder of your home directory./ (root), home, user, and then Downloads.cd to move somewhere new, running pwdafterward confirms the move worked.pwd regularly builds good habits and prevents you from accidentally running commands in the wrong directory.pwd one more time to confirm you are in the Downloads folder.Test Incomplete
~$ pwd~$ pwd~$ pwd~$ pwd~$ pwd~$ pwd