Got a program sucking up system resources? Looking for a possible security breach?
Check out the command `lsof`. The name "lsof" is short for "ls (or list) open files". Using it, you can look at certain processes, file descriptors of a process, or show certain network connections, since network connections use file descriptors like normal files. To identify a suspect process, first run `ps -ef`, which will show the command line and environment information about swapped out processes. Then, run#lsof -sp <pid>
Where "<pid>" is the process ID of the suspect process. The -s option displays the size of all open files. You can also use the "-r<n>" option to redisplay the output of lsof every <n> seconds.
- sandip's blog
- Login or register to post comments