linux 中du命令指定以不同的单位显示文件的大小
001、
(base) [root@pc1 test]# ls (base) [root@pc1 test]# dd if=/dev/zero of=a.txt count=30 bs=1M ## 生成一个测试文件 30+0 records in 30+0 records out 31457280 bytes (31 MB) copied, 0.0231627 s, 1.4 GB/s (base) [root@pc1 test]# ll -h ## 查看该文件 total 30M -rw-r--r--. 1 root root 30M Nov 25 17:47 a.txt (base) [root@pc1 test]# du -b a.txt ## bp 31457280 a.txt (base) [root@pc1 test]# du -k a.txt ## kb 30720 a.txt (base) [root@pc1 test]# du -m a.txt ## mb 30 a.txt (base) [root@pc1 test]# du -h a.txt ## 人类友好可读 30M a.txt
。
分类:
linux shell
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律