How to get the launching dir of a command
Zhenguo Zhang
Bioinformatics scientist dedicated to healthcare innovation, fueled by diverse skills and a commitment to lifelong learning
If you run `ps -ef`, you can find a list of commands running in the system. Can you find the launching dir of each command, i.e., the folder where the command was launched? This can be useful for, for example, checking results.
It is easy: find the PID of a command (the 2nd field of the `ps` command output), and then run the following
pwdx <PID>
Say, the PID is 1354, then run
pwdx 1354
That's it. Have fund.