LSOF
# lsof - shows a list of open files belonging to active processes
# lsof /var/log/syslog - lists processes that opened a specific file
# lsof +D /var/log/ - list opened files under a directory
# lsof -c ssh -c init - list opened files based on process names starting with
# lsof /home - list processes using a mount point
# lost -u username - list files opened by a specific user
# lsof -p 1753 - list all open files by a specific process
# kill -9 lsof -t -u username - kill all processes that belong to a particular user
# losf -u username -c init - combine more list options using or/and
# lsof -u username -c init -a -r5 - execute lsof in repeat mode
# lsof -i - list all network connections
# lsof -i -a -p 234 - list all network files in use by a specific process
# lsof -i :25 - list processes which are listening on a particular port
# lsof -i tcp; lsof -i udp; - list all tcp or udp connections
# lsof -N -u username -a - list all network file system (NFS) files
Last updated
Was this helpful?