Skip to main content

lsof

Network Port

What process is using the port 50000

lsof -i :50000

lsof -i :https

lsof -i tcp:25

lsof -i udp:53
Mount Point

What process is using the mount-point

lsof | grep /path/to/mount-point

lsof +f -- /path/to/dir

lsof +D /path/to/dir
Process

What files and directories are using by the process

lsof -p `pidof <app_name>`

lsof -c apache

lsof | grep apache
User

List files opened by processes belonging to a specific user

lsof -u [user-name]
IP & Domain

List files based on their Internet address

# For IPv4
lsof -i 4

# For IPv6
lsof -i 6
File
lsof -t [file-name]
lsof -t /usr/lib/x86_64-linux-gnu/libpcre2-8.so.0.9.0