Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For exercise - I removed execute permission for others from /bin/pwd:

$ chmod o-x /bin/pwd
$ ls -l /bin/pwd
-rwxr--r-- 1 root root 26568 Apr 28  2010 /bin/pwd

and as logged as matt I cannot execute /bin/pwd as expected:

$ /bin/pwd
$ -bash: /bin/pwd: Permission denied

but sudden it can be executed if not absolute:

$ pwd

Why? Thank you!

share|improve this question
up vote 2 down vote accepted

pwd is a shell built-in. You can see that with

$ type pwd
pwd is a shell builtin

pwd is a built-in in most shells. One reason for that is that it's a very simple command that's used fairly frequently (and running a built-in is faster than spawning an external process). Another reason is that it allows the shell to track symbolic links, so that cd /foo/bar; pwd shows /foo/bar even if bar is a symbolic to /wibble (in bash and many other shells, you can use pwd -P to show /foo/bar and pwd -L to show /wibble; the default is controlled by the -o physical option).

share|improve this answer
Thank you!!! I didn't know that pwd is a built-in! Wow! – dreamcocoa Sep 8 '11 at 21:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.