udp

Mattepuffo's logo
Controllo dei file aperti con Lsof e Fuser

Controllo dei file aperti con Lsof e Fuser

Lsof è un ottimo programma che ci consente di vedere quali sono i file aperti da un determinato processo.

Ha parecchie opzioni interessanti.

Se vogliamo vedere i file aperti da uno specifico programma:

$ lsof -c firefox
COMMAND   PID  USER   FD   TYPE             DEVICE SIZE/OFF     NODE NAME
firefox 24660 matte  cwd    DIR                8,2     4096 45350914 /home/matte
firefox 24660 matte  rtd    DIR                8,2     4096        2 /
firefox 24660 matte  txt    REG                8,2    82352 40507802 /usr/lib/firefox-4.0/firefox
firefox 24660 matte  mem    REG                8,2    15552 40633085 /usr/lib/libcanberra-0.28/libcanberra-alsa.so
firefox 24660 matte  mem    REG                8,2    36576 39342914 /usr/lib/libltdl.so.7.3.0
firefox 24660 matte  mem    REG                8,2    68912 39350927 /usr/lib/libtdb.so.1.2.9
firefox 24660 matte  mem    REG                8,2    23080 39349622 /usr/lib/libogg.so.0.7.1
firefox 24660 matte  mem    REG                8,2   176920 39349634 /usr/lib/libvorbis.so.0.4.5
firefox 24660 matte  mem    REG                8,2    30160 39349633 /usr/lib/libvorbisfile.so.3.3.4
firefox 24660 matte  mem    REG                8,2    65736 39338584 /usr/lib/libcanberra.so.0.2.5
firefox 24660 matte  mem    REG                8,2   192863 39329202 /usr/lib/libaudiofile.so.0.0.2
firefox 24660 matte  mem    REG                8,2    56838 39329237 /usr/lib/libesd.so.0.2.39
firefox 24660 matte  mem    REG                8,2   135240 40373785 /usr/lib/mozilla/plugins/npwrapper.libflashplayer.so
firefox 24660 matte  mem    REG                8,2   135240 40633100 /usr/lib/nspluginwrapper/x86_64/linux/npwrapper.so
firefox 24660 matte  mem    REG                8,2    62448 52166897 /opt/java/jre/lib/amd64/libnpjp2.so
firefox 24660 matte  mem    REG                8,2    10832 39349158 /usr/lib/libXss.so.1.0.0
firefox 24660 matte  mem    REG                8,2    22912 35127433 /lib/libnss_dns-2.13.so
firefox 24660 matte  mem    REG                8,2   574636 40246503 /usr/share/fonts/TTF/DejaVuSans-BoldOblique.ttf
firefox 24660 matte  mem    REG                8,2   359272 40239110 /usr/share/fonts/TTF/FreeSansBold.ttf
firefox 24660 matte  mem    REG                8,2   610412 39356875 /usr/lib/libnssckbi.so
firefox 24660 matte  mem    REG                8,2   412559 39356877 /usr/lib/libfreebl3.so
firefox 24660 matte  mem    REG                8,2   191643 39356876 /usr/lib/libnssdbm3.so
firefox 24660 matte  mem    REG                8,2   297290 39356873 /usr/lib/libsoftokn3.so

..........

L'opzione -c serve proprio a indicare che vogliamo i file aperti da un specifico programma; nel mio caso Firefox.