Admin-Ahead Community

Linux => General Linux => Topic started by: jamesj on June 19, 2017, 02:45:10 pm

Title: To list largest currently open files and the name of the process holding file
Post by: jamesj on June 19, 2017, 02:45:10 pm
lsof  meaning "list open files", which is used in many Unix-like systems to report a list of all open files and the processes that opened them.

Following can be used to show the largest 10 currently open files, the size of those files in Megabytes, and the name of the process holding the file open.

# lsof / | awk '{ if($7 > 1048576) print $7/1048576 "MB" " " $9 " " $1 }' | sort -n -u | tail