Printing Working Directory in Linux Terminal

0

 In order to discover where you are currently located within the filesystem, the pwd command can be used. The pwd command prints the working directory, your current location within the filesystem:

pwd [OPTIONS]

Consider This

Don't turn on your printer just yet! In the early days of computing the command line output would be sent to physical printers. This method was replaced by video displays which could display information more quickly. We still use the word print even though the output is just being displayed on your screen.

The output of the above command indicates that the user is currently in their home folder, shown in the filesystem below.

Filesystem showing root directory at the top and directories underneath, including home directory. Under the home directory is a highlighted sysadmin directory and the directories inside of sysadmin (i.e., Documents) shown below

Consider This

Notice our virtual machines employ a prompt that displays the current working directory, emphasized with the color blue. In the first prompt above, the blue ~ is equivalent to /home/sysadmin, representing the user's home directory.


After changing directories (we will learn how to do this in the next section), the new location can also be confirmed in the new prompt, again shown in blue.

Post a Comment

0Comments
Post a Comment (0)