AMZ DIGICOM

Digital Communication

AMZ DIGICOM

Digital Communication

pwd command: display the path of your directory

PARTAGEZ

The Linux pwd command inserts the full path to your current working directory in a standard display. This command is therefore important if you want to keep an overall view of your directories. It can be adjusted using various options.

What is the pwd command?

On Linux, “pwd” stands for “Print Working Directory”. Along with the cd command in Linux, pwd is one of the most frequently applied commands on a daily basis by users. The main function of pwd is to insert the full path name of the current directory into the result. Each subdirectory is separated from the others by a slash. The pwd command comes as a built-in command and a standalone program. It is present by default in all standard Linux distributions, such as Debian or Ubuntu.

How does the Linux pwd command work?

The pwd command displays the full path to your current directory in the output. It is especially useful when you switch between directories often or if you work with many directories. Thanks to Linux pwd, you always keep an overview of all your paths and can find and save data in a targeted manner, even for large projects.

What is the syntax of the pwd command?

The Linux pwd syntax is very simple and always looks like this:

If you run the command without specifying an option, only the full path name of your current working directory is displayed. However, you can further specify this result using the options.

What are the pwd command options?

The pwd command has two major, mutually exclusive options:

  • -L : in the presence of a symbolic link, it is not decomposed, even if the “physical” option is used in the shell.
  • -P : with this option, any symbolic link is decomposed.

The program /bin/pwd However, it has a single “–help” option with which you can call up additional information for the pwd command.

Examples of using the pwd command

When you enter the pwd command, you always get the address of your current working directory as the result. To do this, run the command as shown in the syntax section above. Here is an example command:

/home/sousrépertoire

bash

If you are using the program, run Linux pwd as follows:

The result is identical to that obtained with the example above:

/home/sousrépertoire

bash

If you now insert the “-L” option, the command looks like this:

The appropriate version would for example be this:

/home/sousrépertoire/dir_simlink

bash

Télécharger notre livre blanc

Comment construire une stratégie de marketing digital ?

Le guide indispensable pour promouvoir votre marque en ligne

En savoir plus

Souhaitez vous Booster votre Business?

écrivez-nous et restez en contact