Skip to main content
1 of 4
Tim
  • 106.8k
  • 234
  • 651
  • 1.1k

Does `ps` provide the working directory of each process?

Is it correct that the output of jobs contains the working directory when initiating the command of each job

$ jobs -l | grep JDBC
[15]  20422 Running   PDFXCview all.pdf &  (wd: ~/mydata/dirlinks/cs/SQL/API/JDBC/general/official/tutorials)
[20]  20542 Running   PDFXCview all.pdf &  (wd: ~/mydata/dirlinks/cs/SQL/API/JDBC/general/wikipedia)

Similarly, in ps, is it possible to get the working directory of each process ?

In pgrep, is it possible to search in the working directory of each process ?

Thanks.

Tim
  • 106.8k
  • 234
  • 651
  • 1.1k