Find where a process is running from Print

  • 16780

You may see a process running and wonder exactly where it's running from. Fortunately, there's a way to find out!

Let's say, for instance, the process is as follows:

# ps aux | grep perl | tail -1
user 852679  0.0  0.0  30920  2472 ?        S    Feb17   0:00 perl main.css

To find out where 'perl main.css' started from:

# ls -l /proc/852679/cwd
lrwxrwxrwx 1 user user 0 Feb 22 16:16 /proc/852679/cwd -> /home/user/public_html/domain.com/

As you can see, process 852679 originated from the directory /home/user/public_html/domain.com/

This can be helpful when tracking down processes that you've not seen before, malware, etc.

Was this answer helpful?

« Back


Ethernet Servers Ltd
124 City Road
London
EC1V 2NX
United Kingdom


Registered Limited Company: #09114946

Telephone:
+44 330 043 1258

Email:
hello@ethernetservers.com

Copyright © 2014 - 2024 - Ethernet Servers Ltd - All Rights Reserved.

Proudly serving customers in 143 countries since July 2014!