网站首页 > 博客文章 正文
df 基本用法
这里d指disk,f代表filesystem文件系统,df 计算出文件系统占用磁盘的比例数据,也可以显示文件索引块inode相关信息。
这节主要分享-a/-h/-k/-T/-t/-x参数,以及其组合用法。
- -a, --all include dummy file systems
显示所有文件系统的占用数据,包括虚假文件系统。
- --total produce a grand total
在末尾增加一个total统计,便于查看。
lance@ubuntu:~/cmd/free$ df --total
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 9156984 2800184 5868608 33% /
udev 503124 4 503120 1% /dev
tmpfs 102524 788 101736 1% /run
none 5120 0 5120 0% /run/lock
none 512604 200 512404 1% /run/shm
total 10280356 2801176 6990988 29%
- -h, --human-readable print sizes in human readable format
按方便阅读的单位显示,即当占用达到Kbyte时,用KB作为显示代为,如果达到M,则按照MB统计,以此类推试用G、T等更大的单位。
lance@ubuntu:~/cmd/free$ df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 8.8G 2.7G 5.6G 33% / udev 492M 4.0K 492M 1% /dev tmpfs 101M 788K 100M 1% /run none 5.0M 0 5.0M 0% /run/lock none 501M 200K 501M 1% /run/shm
- -k like --block-size=1K
按KB单位统计。
lance@ubuntu:~/cmd/free$ df -k Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 9156984 2800188 5868604 33% / udev 503124 4 503120 1% /dev tmpfs 102524 788 101736 1% /run none 5120 0 5120 0% /run/lock none 512604 200 512404 1% /run/shm
- -T, --print-type print file system type
显示文件系统类型,这个参数很有用,增加Type列,列出文件系统的具体类型。
lance@ubuntu:~/cmd/free$ df -T Filesystem Type 1K-blocks Used Available Use% Mounted on /dev/sda1 ext4 9156984 2800188 5868604 33% / udev devtmpfs 503124 4 503120 1% /dev tmpfs tmpfs 102524 788 101736 1% /run none tmpfs 5120 0 5120 0% /run/lock none tmpfs 512604 200 512404 1% /run/shm
- -t, --type=TYPE limit listing to file systems of type TYPE
配合-T参数使用,只显示指定类型的文件系统,比如只显示ext4的占用比。
lance@ubuntu:~/cmd/free$ df -t ext4 Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 9156984 2800188 5868604 33% / lance@ubuntu:~/cmd/free$ df --type=ext4 Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 9156984 2800188 5868604 33% /
- -x, --exclude-type=TYPE limit listing to file systems not of type TYPE
和-t作用正好相反,不查看指定类型的文件系统,比如不查看ext4的信息。
lance@ubuntu:~/cmd/free$ df -x ext4 Filesystem 1K-blocks Used Available Use% Mounted on udev 503124 4 503120 1% /dev tmpfs 102524 788 101736 1% /run none 5120 0 5120 0% /run/lock none 512604 200 512404 1% /run/shm lance@ubuntu:~/cmd/free$ df --exclude-type=ext4 Filesystem 1K-blocks Used Available Use% Mounted on udev 503124 4 503120 1% /dev tmpfs 102524 788 101736 1% /run none 5120 0 5120 0% /run/lock none 512604 200 512404 1% /run/shm
更详细清楚讲解请观看西瓜视频讲解:
猜你喜欢
- 2024-09-14 史上最全的db2日常维护命令总结(db2常用命令大全)
- 2024-09-14 Linux查看磁盘空间和分区用什么命令
- 2024-09-14 Linux 文件系统介绍(linux的系统文件)
- 2024-09-14 「Linux基础篇」(二)Linux基本命令练习
- 2024-09-14 Linux 根目录爆满 解决(/dev/mapper/centos-root 100%问题)
- 2024-09-14 du 及 df 命令的使用(df命令和du命令的区别)
- 2024-09-14 Linux磁盘管理(Linux磁盘管理实验报告)
- 2024-09-14 Go Web 框架 Gin 实践9—将Golang应用部署到Docker
- 2024-09-14 Linux实用命令大全,让你工作效率提升100%
- 2024-09-14 Linux云计算-06_Linux磁盘管理(linux磁盘存储管理)
你 发表评论:
欢迎- 最近发表
-
- 解决Win10打开软件提示“服务器没有及时响应或控制请求”
- 用友UAP解开非结构化大数据处理与分析的密码
- Windows 25H2 修复底层崩溃(windows修复环境)
- 开源技巧:使用Docker实现交互式任务
- Win11 任意版本 直接安装 Android 应用 教程完整版
- Windows Terminal已成为Windows 11操作系统的默认终端
- 那些好莱坞电影中炫酷的特效 原来是这么拍的
- Windows 10 Build 21327.1010发布:测试服务管道更新
- Made in China: The story behind the label
- PowerShell登录远程Linux系统(powershell开启远程桌面)
- 标签列表
-
- ifneq (61)
- 字符串长度在线 (61)
- googlecloud (64)
- flutterrun (59)
- 系统设计图 (58)
- powershellfor (73)
- promise.race (63)
- 2019cad序列号和密钥激活码 (62)
- window.performance (66)
- qt删除文件夹 (72)
- mysqlcaching_sha2_password (64)
- ubuntu升级gcc (58)
- nacos启动失败 (64)
- ssh-add (70)
- jwt漏洞 (58)
- macos14下载 (58)
- yarnnode (62)
- abstractqueuedsynchronizer (64)
- source~/.bashrc没有那个文件或目录 (65)
- springboot整合activiti工作流 (70)
- jmeter插件下载 (61)
- 抓包分析 (60)
- idea创建mavenweb项目 (65)
- qcombobox样式表 (68)
- pastemac (61)
本文暂时没有评论,来添加一个吧(●'◡'●)