Get the App
SLTechnology News&Howtos  ›  Servers  › 

What is the purpose of the pwd command in Linux?

Shulou Source: shulou.com Published: 2022-06-03 06:01:44 09月21日 Update

Today, the editor will bring you an article about the pwd command in Linux. The editor thinks it is very practical, so I will share it for you as a reference. Let's follow the editor and have a look.

Meaning of pwd command character

1.pwd is an acronym for print working directory. Printing the current working directory means to show the current directory.

two。 Usually the current directory is displayed at the prompt, but it only shows the directory name instead of the full path, for example, the current directory is

/ usr/local/etc and the current directory are / etc, and the prompt shows etc. At this time, you can use the pwd command to see which path it is, so as not to make a mistake. This is what this command is for.

In the Linux hierarchy, users can use the mkdir command to create a new directory in any directory authorized, or they can use the cd command to convert from one directory to another. However, there is no prompt to tell the user which directory they are currently in. To know the current directory, you can use the pwd command, which displays the entire pathname.

Linux pwd command

The Linux pwd command is used to display the working directory.

Execute the pwd directive to immediately know the absolute path name of your current working directory.

Grammar

Pwd [--help] [--version]

Parameter description:

-- help online help.

-- version displays version information.

Example

View the current directory:

# pwd/root/test # output result

So much for sharing the pwd commands in Linux. I hope the above can be helpful to you and learn more. If you like this article, you might as well share it for more people to see.

Tags: Directory command path location prompt work prompt that is meaning more user pathname help function utility for this purpose information content parameters online help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Docker OPPO Reno MariaDB Xiaomi