Lsof (LiSt Open Files) is a powerful Unix command utility that comes in handy in many security and performance related sysadmin tasks.
List the PIDs of running httpd processes. The -t option specifies terse output, only PIDs.
List process listening to port 80.
List processes of the specified command (-c). Search is implied in this usage. It essentially searches for any process name starting with the specified value. The second example would list all process starting with m, (mysqld, mutt, etc.)
lsof -c m
Find processes owned by users apache or nobody.
Find the files using the process specified by PID
Find processes with files open in the directory specified.
Popularity: 5%
{ 0 comments }