Find where a process is running from Print
- 16780
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?
Related Articles
Changing the timezone
If you're like us, you'll want your server's timezone to match your local time to make log...
Finding the largest files and directories
This nifty command allows you to built up a list of the largest files and...
Installing and using iftop
The installation commands are as follows:yum -y install libpcap libpcap-devel ncurses...
Installing and using Strace
Strace is a Linux command that allows you to follow what a process on your server is doing. Let's...
Quickly and easily finding the source of emails in Exim
Ever found yourself in the position where there are hundreds, or perhaps, thousands of emails...