Category

Linux Command


Usage

pwdx [options] pid [...]


Manual

Required arguments

  • pid: query process ID. Multiple IDs should be separated by space.

Options

  • -V, --version: Output version information and exit.
  • -h, --help: Output help screen and exit.

Example

First figure out the process id of your interest by using top or ps. For example, you can use the ps command to find the pid (i.e., process identification number) of a process called python:

$ ps aux | grep python

The output looks like the following, and the second column stores the corresponding pid (in this case 12143):

bioq      12143  0.0  0.0 5069496 441196 ?      SNsl Feb03   5:58 /ssd/miniconda3/bin/python e0bf6cc6-b876-4290-8a21-007502aaa69a.json

Then run the command pwdx with the PID:

$ pwdx 12143

The output will tell you the working directory of that process:

12143: /ssd/bioq/graph

Note, if you want to check multiple processes, you can type all the PIDs and separate them by a space:

$ pwdx pid_1 pid_2 pid_3


Share your experience or ask a question