lsof finds, shows, and searches data streams

Slashdot it! Delicious Share on Facebook Tweet! Digg!

GUI

Because working with lsof may overwhelm beginners quickly, Daniele Francesconi developed a graphical interface that provides all the important lsof options and presents the extensive output clearly, at least to a certain degree. The Java tool is called Glsof [2] and consists of two components: Glsof FileMonitor [3] is the simple graphical interface from Figure 1; Glsof Queries [4] serves the administration of multiple lsof instances and is only useful in larger installations.

Figure 1: The Glsof FileMonitor provides a powerful interface for lsof.

In order to use Glsof FileMonitor, download the program archive from SourceForge and save it in the directory of your choice. When you extract it, it will create the directory filemonitor/ with all necessary files. Then you call the GUI with the command from Listing 2. To use Glsof FileMonitor, you have to configure it first. You can do this by clicking on the "hamburger" icon on the far right in the top row and then by selecting the option Preferences .

Listing 2

Running Glsof

$ java -Djava.security.policy=/path/filemonitor/security-client.txt -jar /path/filemonitor/filemonitor.jar

A reusable, retroactively editable configuration can be set up with a click on the plus sign in the toolbar. First, you give it a name, and, in the following dialog, you define the appropriate options and parameters. By default, FileMonitor uses lsof with the options -F -T +c0 -o -n -P to create the output. The FileMonitor option Avoid is equivalent to the lsof counterpart -b , meaning that it ignores blocking functions.

A click on Save saves the configuration (Figure 2) that you now mark with a radio button in Preferences . Now, you can start the data collection with a mouse click on the green button on the right-hand side of the toolbar in the application window. You can filter the shown information any time by typing in text in the field at the top. In addition, there is a selection field, which enables you to restrict the filters to certain lsof columns. A click on the funnel symbol activates the filter. A click on the brush icon will be delete all the filters, and the whole display will be cleaned.

Figure 2: The configuration of Glsof FileMonitor is managed via the Preferences dialog.

Conclusion

lsof is one of Linux's real power tools and proves to be a valuable help in diagnosing various cases of problems. However, as a basic requirement, the user needs a reasonably founded knowledge about the system's internal interrelationships. Nevertheless, even less experienced users can gather information with lsof that simpler applications like Fuser cannot provide, especially when it comes to blocked resources.

That said, before using lsof, you should definitely take a look in the man page, as well as in the FAQ [5] that supplies useful information and tips.

Buy this article as PDF

Express-Checkout as PDF

Pages: 5

Price $0.99
(incl. VAT)

Buy Ubuntu User

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content