Linux list open files by process ID

 

Listing open files by a process will help in debugging any process.

To list open files and configurations used by any process ID we can use lsof command.

To view open files and configurations used by process ID 12345 use following command:

$ lsof -p 12345

This will list all files used by process ID.

We can use lsof with process name also.

To view list of open files for firefox use following command:

$ lsof -p `pidof firefox`

Similarly we can use above command for other processes.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s