When I check a process which can use over 10000 file descriptors, lsof only shows 4 digit. (that is it can only show 9999)

When over 10000, it start with a asterisk sign. For example:

a.out     29944 root 9995u  IPv6 846704101      0t0       TCP> (ESTABLISHED)
a.out     29944 root 9996u  IPv6 846706748      0t0       TCP> (ESTABLISHED)
a.out     29944 root 9997u  IPv6 846708259      0t0       TCP> (ESTABLISHED)
a.out     29944 root *000u  IPv6 846710907      0t0       TCP> (ESTABLISHED)
a.out     29944 root *002u  IPv6 846714817      0t0       TCP> (ESTABLISHED)
a.out     29944 root *003u  IPv6 846720366      0t0       TCP> (ESTABLISHED)
a.out     29944 root *004u  IPv6 846722078      0t0       TCP> (ESTABLISHED)
a.out     29944 root *005u  IPv6 846735778      0t0       TCP> (ESTABLISHED)
a.out     29944 root *006u  IPv6 846736777      0t0       TCP> (CLOSE_WAIT)

How can I get more information (more digits)?

Or what command can I use to collect all file descriptors of a process?

1 Answer 1


Since I were running into a somehow similar problem, I wanted to share my findings here too. I did some research regarding Custom lsof output and found that

lsof's internal formatting options are quite restrictive ...

However, after reading in the manpage about OUTPUT, OUTPUT FOR OTHER PROGRAMS and in other discussions I've learned how to exclude certian types of file descriptors (FD), i.e.

lsof -u ${USER} -a -d "^mem,^cwd,^rtd,^txt"

or how to limit the lsof output to just numeric FDs, i.e.

lsof -u ${USER} -a -d "0-999999"

To list only numeric FDs for a specific process ID (PID) and for further processing in an other program I've used the following approach

lsof -p ${PID} -a -d "0-999999" -Ff

I haven't created and test it for bigger numbers of FDs yet, but maybe it helps collect all descriptors you are interested in.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.