Linux Tip- Files Open by a Process

There are plenty of times I’ve needed to debug something I’m running as a process on a *nix box and couldn’t/didn’t think to prefix the command with strace. Here’s a quick tip I find useful:
List the file descriptors in use by a process:

ls -l /proc/process-id-here/fd
Advertisements

2 thoughts on “Linux Tip- Files Open by a Process

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