Find the Process that Listen to a Port
Find the process that are listening to a said port…
lsof -i :80
Find the process that are listening to a said port…
lsof -i :80
Display a list of files opened by processes
lsof -p NUMBER
Find the process that’s opened the file from a specified directory. You can use this if you cannot unmount a USB drive and want to know which file is open.
lsof +D /media/usb