How To Use pwd Command In Linux / UNIX {with examples}

How To Use pwd Command In Linux / UNIX {with examples}

The pwd (print working directory) command is a basic Linux and Unix command that allows you to display the current working directory, or the directory that you are currently in.

Here are some examples of how to use the pwd command:

  1. To display the current working directory, simply type pwd at the command prompt and press Enter. For example:
$ pwd
/home/user
Source‮al.www:‬utturi.com

This will display the full path of the current working directory.

  1. To display the current working directory in a concise format, you can use the -P option. For example:
$ pwd -P
/home/user

This will display the current working directory in a more concise format, without any symbolic links.

  1. To display the current working directory in a format that includes symbolic links, you can use the -L option. For example:
$ pwd -L
/home/user/link/to/current/directory

This will display the current working directory in a format that includes symbolic links.

  1. To display the current working directory in a format that is compatible with other shells, you can use the --bash option. For example:
$ pwd --bash
/home/user

This will display the current working directory in a format that is compatible with other shells, such as Bash.

It's important to note that the pwd command has a number of other options and features, including options to display the current working directory in other formats and to display the current working directory in a format that is compatible with other utilities. Consult the pwd man page and online resources for more information on how to use the pwd command.

Created Time:2017-10-29 22:08:34  Author:lautturi