Lsof
From Wikipedia, the free encyclopedia
- The correct title of this article is lsof. The initial letter is shown capitalized due to technical restrictions.
lsof is a command meaning "list of open files", which is used in many Unix-like systems that is used to report a list of all open files and the processes that opened them. It works in and supports several UNIX flavors.[1]
Open files in the system include disk files, pipes, network sockets and devices opened by all processes. One use for this command is when a disk cannot be unmounted because (unspecified) files are in use. The listing of open files can be consulted (suitably filtered if necessary) to identify the process that is using the files.
# lsof /var COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME syslogd 350 root 5w VREG 222,5 0 440818 /var/adm/messages syslogd 350 root 6w VREG 222,5 339098 6248 /var/log/syslog cron 353 root cwd VDIR 222,5 512 254550 /var -- atjobs
[edit] See also
[edit] References
- ^ W. Richard Stevens, Bill Fenner, Andrew M. Rudoff (2003), Unix Network Programming: the Sockets networking API , Addison-Wesley Professional, ISBN 0131411551
[edit] External links
- lsof manpage on www.netadmintools.com
- Vic Abell's homepage, author of lsof.
- Sam Nelson's PCP script, an alternative to "lsof -i" for Solaris.
Unix command line programs and builtins (more) | |||
File and file system management: | cat | cd | chmod | chown | chgrp | cp | du | df | file | fsck | ln | ls | lsof | mkdir | mount | mv | pwd | rm | rmdir | split | touch | ||
Process management: | at | chroot | crontab | exit | kill | killall | nice | pgrep | pidof | pkill | ps | sleep | time | top | wait | watch | ||
User Management/Environment: | env | finger | id | mesg | passwd | su | sudo | uname | uptime | w | wall | who | whoami | write | ||
Text processing: | awk | comm | cut | ex | head | iconv | join | less | more | paste | sed | sort | tail | tr | uniq | wc | xargs | ||
Shell programming: | echo | expr | printf | unset | Printing: | lp |
Communications: inetd | netstat | ping | rlogin | traceroute |
Searching: find | grep | strings |
Miscellaneous: banner | bc | cal | man | size | yes |