What is the pwd command in Linux?

In this article, you will learn about what is the pwd command in Linux and how can you use it?

The pwd is the command in Linux and Unix-like operating systems. In short, we use the pwd command to print the name of the current working directory path.

In general, pwd stands for Print Working Directory. So if you want to know the current path of the working directory, then you can use this command.

The path always starts with / ( it’s known as root partition). The pwd is a shell built-in command and its binary file is located in /usr/bin/pwd.

If you like to watch the pwd command video then you can watch the video.

pwd command in Linux | Watch the pwd command in the video.

How to get help for the pwd command

I always suggest reading the manual page and help. So, it will give you an in-depth introduction to the command.

To get the manual page, you can type the below command.

man pwd

So, to get the only command options, you can type the below command. But, when you type for help, first you get an error for the invalid option, and then you will get output pwd [-LP], where -L stands for logical, and -P stands for Physical. But there is no use of these arguments along with the pwd command. The primary purpose of using it is the only pwd command.

pwd --help
pwd command
Linux pwd help command

Syntax of the pwd command

As we know now, how to get some information about the pwd command using the above command with arguments. So, now let’s talk about pwd syntax. The syntax of the pwd command is as below.

pwd [options]...

How to use the pwd command or How to print Current Working Directory

If you want to know how to use the pwd command then, you can type pwd on the Terminal. As a result, It will print out the current working directory path on the Terminal.

pwd

Also, you can see the output of the pwd command in the below picture.

pwd command in Linux
Example of the pwd command

Conclusion

In this article, you learned about the pwd command and also how to use it. Also, you can see that it is easy to use. So, I hope you understand, but, if you have any questions, you can feel free to ask in the comment section. If you like to read a little more about the history of the pwd command then you can visit the Wikipedia pwd command page

You may like to read about

Leave a Reply

Your email address will not be published.