Skip to Content
Mac OS X in a Nutshell
book

Mac OS X in a Nutshell

by Jason McIntosh, Chuck Toporek, Chris Stone
January 2003
Intermediate to advanced
832 pages
32h 40m
English
O'Reilly Media, Inc.
Content preview from Mac OS X in a Nutshell

Name

lsof

Synopsis

lsof [options] [pathname]

List open files, including regular files, directories, special files, libraries, network files, and others. The following descriptions and examples cover lsof’s basic operation; for a complete description, refer to lsof’s manpage.

Used without arguments, lsof will list all files opened by all active processes. Used with pathname, lsof will list the open files in the given file system mount point. If pathname is a file, lsof will list any processes having the given file open.

Selected Options

-a

Recognize all list options as joined with “and” instead of the default “or.”

-c chars

List files opened by processes whose command names begin with characters chars. chars can contain a regular expression if put between slashes (/). You can further define the expression by following the closing slash with b, to denote a basic expression, i to denote a case-insensitive expression, or x to denote an extended expression (the default).

+d pathname

List all open instances of the files and directories in pathname, including the directory pathname itself. This option does not search below the level of pathname, however.

+D pathname

List all open instances of the files and directories in pathname, including directory pathname itself, searching recursively to the full depth of directory pathname.

-i [ address ]

List all Internet files, or if specified, those with a Internet address matching address. Specify address as [protocol][@host][:port].

version ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mac OS X Internals: A Systems Approach

Mac OS X Internals: A Systems Approach

Amit Singh
C++ In a Nutshell

C++ In a Nutshell

Ray Lischner
Linux Shell Scripting Cookbook - Third Edition

Linux Shell Scripting Cookbook - Third Edition

Clif Flynt, Sarath Lakshman, Shantanu Tushar
Optimized C++

Optimized C++

Kurt Guntheroth

Publisher Resources

ISBN: 0596003706Supplemental ContentCatalog PageErrata