I have a little script that runs lsof on my laptop (Ubuntu Natty) every now and then to check for a few things. I recently noticed that it runs really slowly when I have Chromium or Firefox open.
Without Chromium open:
$ lsof | wc -l
5288
With:
$ lsof | wc -l
5721
Without:
$ time lsof > /dev/null
real 0m0.134s
user 0m0.080s
sys 0m0.040s
With:
$ time lsof > /dev/null
real 0m20.250s
user 0m0.080s
sys 0m0.070s
lsof seems to get "stuck" when looking at the browser's entries.
I'm just curious why it's happening, and if there's a way around it. Suggestions?
Best Answer
Try the -n option: