O'Reilly logo

Troubleshooting Ruby Processes: Leveraging System Tools when the Usual Ruby Tricks Stop Working by Philippe Hanrigou

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Section #3. lsof

What Is It?

lsof 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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required