Add new comment

lsof - examples

lsof /bin/bash
lists all processes that use the bash shell

lsof -p PID
lists all open files of the process with the given PID

lsof +D /tmp
lists all open files in "/tmp" and its subdirectories without paying attention to symbolic links

lsof -u user
lists all files that are opened by the given user

lsof -u ^user
lists all opened files that are not opened by the given user

lsof -d txt
process list a la ps aux

lsof +L1
lists all deleted files, that are still opened and use up disk space (files with less than one link)

lsof -i
network-relevant files

lsof -i -P -n
all network-relevant files without spelling out the port numbers as services and without resolving the hostname

lsof -i6
ipv6-related files

lsof -i|grep '\->'
lists all active connections

lsof -a -i -u www-data
lists all network files opened by the user www-data (boolean and with -a)

 
 

Technology: