Why pwd does not accept long options like --physical?

bash has a built-in command pwd which is what you are using when you simply type pwd into your shell.

To get the pwd as described by the manpage, you need force use of the external command. You can do this by specifying the full path to the executable (/bin/pwd in your case) or by prepending env before the line: env pwd, which starts the env command which can be used to add settings to the environment (but which is not done here) and then env starts the command specified. As env doesn't have a builtin pwd, the "real" /bin/pwd is executed.

The advantage of the builtin pwd in bash is that bash keeps track of the current directory, so getting the value is at zero cost, whereas the external command needs to search up through the filesystem to determine the path, which is much more IO intensive.


That manpage documents /bin/pwd, but when you run pwd you’re using the shell built-in; see the output of

type pwd

Your shell’s built-in pwd doesn’t support long options (see your shell’s documentation; since you’re using Bash, help pwd will provide a summary).

Tags:

Bash

Rhel

Pwd