October 2007
Intermediate to advanced
58 pages
59m
English
lsoflsof stands for “LiSt Open Files.” This command seems deceptively simple: It lists information about files opened by processes on a UNIX box.
Despite its (apparent) modest mission statement, lsof is actually one of the most powerful and useful UNIX commands. Its raw power comes from one of UNIX’s design principle often described as “in UNIX everything is a file.”3 What this means is that the lsof concept of an open file not only covers regular files but also the following:
• Directories
• Streams or network files (for example, Internet or UNIX domain sockets and NFS files)
• Native libraries (for example, .so or .dylib dynamic libraries linked to a process)
• Block and character special files (for example, disk volume, ...