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

pwdx is supposed to print out the current working directory of a process given a process id.

Normally this looks something like:

$ sudo pwdx 1
1: /

$ pwdx $$
5251: /home/foo

One one machine I have it always returns the same gibberish string

$ pwdx 1
1: H?l$?L?|$?H?-

$ pwdx 24535
24535: H?l$?L?|$?H?-

$ pwdx $$
24351: H?l$?L?|$?H?-
share|improve this question
up vote 1 down vote accepted

Use the equivalent:

readlink -f /proc/PID/cwd
share|improve this answer

Intresting. pwdx is really simple, code-wise; it just resolve the 'cwd' symlink target in /prod/pid

What do you get from this?

ls -l /proc/$$/cwd

Also, what distribution/architecture are you on? Default character set? Here's a link to the source if you want to try building your own. You shouldn't need to do anything outside of "make".

share|improve this answer
distribution = it's Ubuntu server 10.04.2 x86_64; I suspect the character set is utf8 but I don't know how to check; /proc/[pid]/cwd seems to work correctly – ʞɔıu Jul 19 '11 at 14:35
actually it's 9.04 – ʞɔıu Jul 19 '11 at 15:13

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.