21、磁盘管理命令 df、du、tree

21、磁盘管理命令 df、du、tree

1、df 命令

查询系统所有磁盘使用情况,默认显示单位为KB。

2、du 命令

du [选项] [文件或目录]

查询系统指定磁盘使用情况,默认为当前目录。

[root@localhost /]# du -hac  /files/top.txt
140K    /files/top.txt
140K    总用量

 

 3、tree 命令

以树状图列出目录的内容

注:如果没有tree 命令,使用yum install tree 安装

[root@localhost /]# tree -L 2 /files
/files
├── date_cal.sh
└── top.txt0 directories, 2 files