Wéi kontrolléiert d'Linux Dateisystem Disk Space Utilisatioun


Um Internet fannt Dir vill Tools fir d'Benotzung vun der Disk Space an Linux ze kontrolléieren. Wéi och ëmmer, Linux huet e staarkt agebauten Utility genannt 'df'.

De 'df' Kommando steet fir Disk Dateiesystem, et gëtt benotzt fir e komplette Resumé vun verfügbaren a benotzte Disk Space Notzung vum Dateiesystem am Linux System ze kréien.

Benotzt '-h' Parameter mat (df -h) wäert d'Dateisystem Disk Space Statistiken am human-liesbare Format weisen, heescht datt et d'Detailer a Bytes, Megabytes a Gigabyte gëtt.

Dësen Artikel erkläert e Wee fir déi voll Informatioun vu Linux Disk Space Notzung mat der Hëllef vum 'df' Kommando mat hire praktesche Beispiller ze kréien. Also, Dir kënnt d'Benotzung vum df Kommando am Linux besser verstoen.

1. Check Dateisystem Disk Space Notzung

De Kommando df weist d'Informatioun vum Apparatnumm, Gesamtblocken, Gesamt Disk Space, benotzten Disk Space, verfügbaren Disk Space, a Mountpunkten op engem Dateiesystem.

 df

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/cciss/c0d0p2     78361192  23185840  51130588  32% /
/dev/cciss/c0d0p5     24797380  22273432   1243972  95% /home
/dev/cciss/c0d0p3     29753588  25503792   2713984  91% /data
/dev/cciss/c0d0p1       295561     21531    258770   8% /boot
tmpfs                   257476         0    257476   0% /dev/shm

2. Display Informatioun vun all Dateisystem Disk Space Notzung

Datselwecht wéi hei uewen, awer et weist och Informatioun iwwer Dummy Dateisystemer zesumme mat all Dateiesystem Disk Notzung an hir Erënnerungsnotzung.

 df -a

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/cciss/c0d0p2     78361192  23186116  51130312  32% /
proc                         0         0         0   -  /proc
sysfs                        0         0         0   -  /sys
devpts                       0         0         0   -  /dev/pts
/dev/cciss/c0d0p5     24797380  22273432   1243972  95% /home
/dev/cciss/c0d0p3     29753588  25503792   2713984  91% /data
/dev/cciss/c0d0p1       295561     21531    258770   8% /boot
tmpfs                   257476         0    257476   0% /dev/shm
none                         0         0         0   -  /proc/sys/fs/binfmt_misc
sunrpc                       0         0         0   -  /var/lib/nfs/rpc_pipefs

3. Show Disk Space Notzung am Mënsch Liesbare Format

Hutt Dir gemierkt datt déi uewe genannte Kommandoen Informatioun a Bytes weisen, wat guer net liesbar ass, well mir d'Gewunnecht hunn d'Gréissten a Megabytes, Gigabytes, asw.

De Kommando df bitt eng Optioun fir Gréissten an Human Readable Formater ze weisen andeems Dir -h benotzt (dréckt d'Resultater am mënschlech liesbare Format (z.B. 1K 2M 3G)).

 df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/cciss/c0d0p2      75G   23G   49G  32% /
/dev/cciss/c0d0p5      24G   22G  1.2G  95% /home
/dev/cciss/c0d0p3      29G   25G  2.6G  91% /data
/dev/cciss/c0d0p1     289M   22M  253M   8% /boot
tmpfs                 252M     0  252M   0% /dev/shm

4. Display Informatiounen vun/doheem Dateisystem

Fir d'Informatioun vun nëmmen Apparat/Heem Dateisystemer am mënschlech liesbare Format ze gesinn, benotzt de folgende Kommando.

 df -hT /home

Filesystem		Type    Size  Used Avail Use% Mounted on
/dev/cciss/c0d0p5	ext3     24G   22G  1.2G  95% /home

5. Display Informatioun vum Dateisystem an Bytes

Fir all Dateisysteminformatioun an d'Benotzung an 1024-Byte-Blocken ze weisen, benotzt d'Optioun '-k' (zB --block-size=1K) wéi follegt.

 df -k

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/cciss/c0d0p2     78361192  23187212  51129216  32% /
/dev/cciss/c0d0p5     24797380  22273432   1243972  95% /home
/dev/cciss/c0d0p3     29753588  25503792   2713984  91% /data
/dev/cciss/c0d0p1       295561     21531    258770   8% /boot
tmpfs                   257476         0    257476   0% /dev/shm

6. Display Informatioun vum Dateisystem an MB

Fir Informatioun iwwer all Dateiesystemverbrauch an MB (MegaByte) ze weisen, benotzt d'Optioun '-m'.

 df -m

Filesystem           1M-blocks      Used Available Use% Mounted on
/dev/cciss/c0d0p2        76525     22644     49931  32% /
/dev/cciss/c0d0p5        24217     21752      1215  95% /home
/dev/cciss/c0d0p3        29057     24907      2651  91% /data
/dev/cciss/c0d0p1          289        22       253   8% /boot
tmpfs                      252         0       252   0% /dev/shm

7. Display Informatioun vum Dateisystem an GB

Fir Informatioun vun all Dateisystemstatistiken a GB (Gigabyte) ze weisen, benotzt d'Optioun als 'df -h'.

 df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/cciss/c0d0p2      75G   23G   49G  32% /
/dev/cciss/c0d0p5      24G   22G  1.2G  95% /home
/dev/cciss/c0d0p3      29G   25G  2.6G  91% /data
/dev/cciss/c0d0p1     289M   22M  253M   8% /boot
tmpfs                 252M     0  252M   0% /dev/shm

8. Display Dateisystem Inoden

Mat -i Schalter gëtt d'Informatioun vun enger Zuel vun benotzten Inoden an hire Prozentsaz fir de Dateiesystem ugewisen.

 df -i

Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/cciss/c0d0p2    20230848  133143 20097705    1% /
/dev/cciss/c0d0p5    6403712  798613 5605099   13% /home
/dev/cciss/c0d0p3    7685440 1388241 6297199   19% /data
/dev/cciss/c0d0p1      76304      40   76264    1% /boot
tmpfs                  64369       1   64368    1% /dev/shm

[ Dir kënnt och gär hunn: Wéi d'Disk Inode Zuel op Linux erhéijen]

9. Haaptsäit Fichier System Typ

Wann Dir all déi uewe genannte Kommandoenausgab bemierkt, gesitt Dir datt et keen Linux Dateisystemtyp an de Resultater ernimmt gëtt. Fir den Dateisystemtyp vun Ärem System z'iwwerpréiwen, benotzt d'Optioun 'T'. Et weist Dateisystemtyp zesumme mat aner Informatioun.

 df -T

Filesystem		Type   1K-blocks  Used      Available Use% Mounted on
/dev/cciss/c0d0p2	ext3    78361192  23188812  51127616  32%   /
/dev/cciss/c0d0p5	ext3    24797380  22273432  1243972   95%   /home
/dev/cciss/c0d0p3	ext3    29753588  25503792  2713984   91%   /data
/dev/cciss/c0d0p1	ext3    295561     21531    258770    8%    /boot
tmpfs			tmpfs   257476         0    257476    0%   /dev/shm

10. Ëmfaasst bestëmmte Fichier System Typ

Wann Dir e bestëmmte Dateisystemtyp wëllt weisen, benotzt d'Optioun '-t'. Zum Beispill weist de folgende Kommando nëmmen den ext3 Dateisystem.

 df -t ext3

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/cciss/c0d0p2     78361192  23190072  51126356  32% /
/dev/cciss/c0d0p5     24797380  22273432   1243972  95% /home
/dev/cciss/c0d0p3     29753588  25503792   2713984  91% /data
/dev/cciss/c0d0p1       295561     21531    258770   8% /boot

11. Ausgeschloss bestëmmte Fichier System Typ

Wann Dir e Dateisystemtyp wëllt weisen deen net zum ext3 Typ gehéiert, benotzt d'Optioun '-x'. Zum Beispill gëtt de folgende Kommando nëmmen aner Dateiesystemertypen aner wéi ext3.

 df -x ext3

Filesystem           1K-blocks      Used Available Use% Mounted on
tmpfs                   257476         0    257476   0% /dev/shm

12. Display Informatiounen vun df Command.

Benotzt --help' Schalter wäert eng Lëscht vun verfügbaren Optiounen weisen, déi mam df Kommando benotzt gëtt.

 df --help

Usage: df [OPTION]... [FILE]...
Show information about the file system on which each FILE resides,
or all file systems by default.

Mandatory arguments to long options are mandatory for short options too.
  -a, --all             include dummy file systems
  -B, --block-size=SIZE use SIZE-byte blocks
  -h, --human-readable  print sizes in human readable format (e.g., 1K 234M 2G)
  -H, --si              likewise, but use powers of 1000 not 1024
  -i, --inodes          list inode information instead of block usage
  -k                    like --block-size=1K
  -l, --local           limit listing to local file systems
      --no-sync         do not invoke sync before getting usage info (default)
  -P, --portability     use the POSIX output format
      --sync            invoke sync before getting usage info
  -t, --type=TYPE       limit listing to file systems of type TYPE
  -T, --print-type      print file system type
  -x, --exclude-type=TYPE   limit listing to file systems, not of type TYPE
  -v                    (ignored)
      --help     display this help and exit
      --version  output version information and exit

SIZE may be (or maybe an integer optionally followed by) one of the following:
kB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.

Report bugs to <[email >.

Liest och:

  • 10 fdisk Kommandoen fir Linux Disk Partitionen ze managen
  • 10 Nëtzlech du Kommandoen fir Disk Notzung vu Dateien a Verzeichnungen ze fannen
  • Ncdu an NCurses Based Disk Usage Analyzer and Tracker
  • Wéi fannt Dir Top Verzeechnes a Dateien (Disk Space) a Linux
  • 9 Tools fir Linux Disk Partitionen a Benotzung am Linux ze iwwerwaachen