← Back to blog
Linux
Centos What files are open to that PID
29 August 2013
Find out what files are open by that pid file.
1. Find the pid for you service
ps aux | grep httpd
apache 24179 0.0 0.0 251316 15528 ? S 08:58 0:00 /usr/sbin/httpd
Here this pid is 8582 now list all files open by that pid.
2. List files beloning to that file
lsof -p 24179
OR
ls -l /proc/24179/fd
l-wx------ 1 root root 64 Aug 29 09:04 113 -> /var/log/httpd/access_log_sycochuck l-wx------ 1 root root 64 Aug 29 09:04 114 -> /var/log/httpd/_apache_access_log l-wx------ 1 root root 64 Aug 29 09:04 115 -> /var/log/httpd/_apache_access_log l-wx------ 1 root root 64 Aug 29 09:04 116 -> /var/log/httpd/_apache_access_log