Linux df命令詳解


df命令的功能是用來檢查linux服務器的文件系統的磁盤空間占用情況。

df常見命令參數

-a, --all             include dummy file systems
  -B, --block-size=SIZE  use SIZE-byte blocks
      --direct          show statistics for a file instead of mount point
      --total           produce a grand total
  -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)

 

常用的命令展示:

顯示所有磁盤空間占用情況

df -ha  【-a  顯示所有】

注意: tmpfs 是一個不存在於實體硬盤上、而是駐在記憶里的特殊文件系統。其中一個副作用就是當你失去電源(或重就開機)時,tmpfs 上的一切內容都會消失。tmpfs 駐守在內存里,它的速度極快。它的尋覓時間與駐守在硬盤上的一般文件系統根本不能相比。

    mount  -t tmpfs tempfilesystem /mnt/tmpfs      【手動掛載tmpfs文件系統】

以inode模式顯示磁盤使用情況

[root@localhost omc]# df -i

image

顯示指定類型磁盤

[root@localhost omc]# df -ht ext4

image

列出文件系統的類型【常用】

[root@localhost omc]# df -h

image


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM