How to use the Pwd command in Linux ?

Linux

The Pwd command is a Linux command used to display the current working directory. It stands for print working directory. A working directory is a directory in which the user is currently working. When you open a terminal, the default directory is usually your home directory. The pwd command displays the full path of the working directory. 

Here at Fixwebnode, we shall look into how to use the pwd command in Linux. 

 

Using PWD Command

The basic syntax for using the pwd command is as follows:

$ pwd

When you enter this command, it will display the full path of your current working directory. 

 

PWD Command Options

The pwd command does not have any options. 

 

 

Practical Examples of using the PWD Command

1. To print the current working directory:

$ pwd

 

2. To print the current working directory of a particular user:

$ pwd -u <username>

 

3. To print the current working directory of a remote system:

$ ssh <username>@<ip_address> pwd

 

4. To print the current working directory of a specific file or directory:

$ pwd <file/directory>

 

5. To print the current working directory of all running processes:

$ pwd -a

 

6. To print the current working directory of all users:

$ pwd -u

 

7. To print the current working directory of a specified user:

$ pwd -u <username>

 

8. To print the current working directory of a particular directory:

$ pwd -d <directory>

 

9. To print the current working directory of all running processes owned by a specific user:

$ pwd -a -u <username>

 

10. To print the current working directory of all files in the current directory:

$ pwd -f

 

11. To print the current working directory of all files in a specific directory:

$ pwd -f <directory>

 

[Need Technical Support ? We are here. ]

 


Conclusion

Your Cart