هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
ماذا يفعل
df (disk free) lists the mounted file systems with their size, used space, free space, use percentage and mount point. It is the first command when somebody says "the disk is full".
With -h sizes are easy to read; with -T you also see the type (xfs, ext4, tmpfs, nfs). With -i it shows inodes: a disk can also be "full" when all inodes are used (millions of tiny files), even if there is free space.
طريقة الكتابة
df [OPTION]... [FILE]...الخيارات 18
الأكثر استخدامًا
لا يوجد شيء يطابق هذا الفلتر.
أمثلة 11
$ مستخدم عادي# بصلاحية root (أو مع sudo)
1Show all file systems with readable sizes
df -hLook at the Use% column. Above 90% needs action.
2Show the types too
df -hTYou see which ones are xfs, ext4, tmpfs or NFS.
3Which file system holds this folder?
df -h /var/logShows the file system that the folder is on.
4Check inodes when the disk is "full" but has space
df -i /var100% IUse% means no new files can be made. Look for folders with millions of small files.
5Only real disks, no tmpfs
df -h -x tmpfs -x devtmpfsA cleaner list for reports.
6Only XFS file systems
df -hT -t xfsUseful when you check the volumes you created in the LVM chapter.
7Choose the columns for a report
df -h --output=target,size,used,avail,pcentEasy to read and to paste in a ticket.
8Alert when a file system is above 85% (monitoring script)
df -P | awk 'NR>1 && $5+0 > 85 {print "WARN", $6, $5}'-Pkeeps each file system on one line, so awk reads it safely.9Check a new mount
mount /dev/vdb1 /mnt/data && df -h /mnt/dataConfirms the size and that the mount worked.
10Only local file systems
df -hlSkips NFS shares that may hang when the server is down.
11Show the total of all file systems
df -h --total | tail -1One number for the whole server.
لا يوجد شيء يطابق هذا الفلتر.
انتبه
الملفات
/proc/self/mountinfo- The list of mounts that df reads.
نصائح للحفظ
df -hT= which disk, how full, what type.df -i= inodes.- df = per file system, du = per folder.