创作背景:

在linux下查看目录文件所占大小

ls # 是查看目录下有哪些文件ls -l # 查看文件大小,total总用量是以K为单位,单个文件是以B为单位ls -lh # 查看文件大小,total总用量是以M为单位ls -lht # 查看文件大小
[root@vm1 ~]# ls
t1.txt  t2.txt  t3.txt  t4.txt  t5.txt  t6.txt  t7.txt  t8.txt  t9.txt
[root@vm1 ~]# ls -l
total 1620
-rw-r--r-- 1 root root 182643 Apr  1 13:36 t1.txt
-rw-r--r-- 1 root root 182643 Apr  1 13:37 t2.txt
-rw-r--r-- 1 root root 182643 Apr  1 13:37 t3.txt
-rw-r--r-- 1 root root 182643 Apr  1 13:37 t4.txt
-rw-r--r-- 1 root root 182643 Apr  1 13:37 t5.txt
-rw-r--r-- 1 root root 182643 Apr  1 13:37 t6.txt
-rw-r--r-- 1 root root 182643 Apr  1 13:37 t7.txt
-rw-r--r-- 1 root root 182643 Apr  1 13:38 t8.txt
-rw-r--r-- 1 root root 182643 Apr  1 13:38 t9.txt
[root@vm1 ~]#
[root@vm1 ~]# ls -lh
total 1.6M
-rw-r--r-- 1 root root 179K Apr  1 13:36 t1.txt
-rw-r--r-- 1 root root 179K Apr  1 13:37 t2.txt
-rw-r--r-- 1 root root 179K Apr  1 13:37 t3.txt
-rw-r--r-- 1 root root 179K Apr  1 13:37 t4.txt
-rw-r--r-- 1 root root 179K Apr  1 13:37 t5.txt
-rw-r--r-- 1 root root 179K Apr  1 13:37 t6.txt
-rw-r--r-- 1 root root 179K Apr  1 13:37 t7.txt
-rw-r--r-- 1 root root 179K Apr  1 13:38 t8.txt
-rw-r--r-- 1 root root 179K Apr  1 13:38 t9.txt
[root@vm1 ~]#
[root@vm1 ~]# ls -lht
total 1.6M
-rw-r--r-- 1 root root 179K Apr  1 13:38 t9.txt
-rw-r--r-- 1 root root 179K Apr  1 13:38 t8.txt
-rw-r--r-- 1 root root 179K Apr  1 13:37 t7.txt
-rw-r--r-- 1 root root 179K Apr  1 13:37 t6.txt
-rw-r--r-- 1 root root 179K Apr  1 13:37 t5.txt
-rw-r--r-- 1 root root 179K Apr  1 13:37 t4.txt
-rw-r--r-- 1 root root 179K Apr  1 13:37 t3.txt
-rw-r--r-- 1 root root 179K Apr  1 13:37 t2.txt
-rw-r--r-- 1 root root 179K Apr  1 13:36 t1.txt
[root@vm1 ~]#
[root@vm1 ~]#

ls -lht --time-style=long-iso# ls -lht可以查看文件大小以M来显示# --time-style=long-iso 显示年月日时分ls -l --time-style=full-iso #显示精确到毫秒ls -l --time-style=iso   ls -l --time-style=locale  #显示月日时分ls -l --time-style '+%Y/%m/%d %H:%M:%S' #自定义显示方式

参考

https://www.cnblogs.com/sxdcgaq8080/p/10102053.html

https://www.cnblogs.com/iyoume2008/p/6105590.html

linux查看文件大小ls相关推荐

  1. Linux查看文件大小并排序

    linux查看文件大小并排序 一.du命令 1.du排序 2.du常用命令 二,ls命令 一.du命令 1.du排序 按字节排序,按兆(M)加参数 'h' du -s /usr/* | sort -r ...

  2. Linux查看文件大小的几种方法(超全)

    一.stat命令 stat指令:文件/文件系统的详细信息显示. stat命令主要用于显示文件或文件系统的详细信息,该命令的语法格式如下: -f 不显示文件本身的信息,显示文件所在文件系统的信息 -L ...

  3. linux显示总文件大小命令,linux查看文件大小命令

    linux系统不像windows系统,查看文件可以随时点击右键,linux中碳钢命令来查看文件大小,下面由学习啦小编为大家整理了linux查看文件命令的相关知识,希望对大家有帮助! linux查看文件 ...

  4. linux stat获取文件大小,Linux查看文件大小的几种方法示例 stat du ls awk (转)

    stat命令 stat指令:文件/文件系统的详细信息显示. stat命令主要用于显示文件或文件系统的详细信息,该命令的语法格式如下: -f 不显示文件本身的信息,显示文件所在文件系统的信息 -L 显示 ...

  5. linux中df和ls区别,linux系统文件大小ls、df、du命令的区别

    发现一台用户的电脑,df检查出来的/磁盘空间占用了16G,比用du查看得到的磁盘空间大的多,du查看/下所有程序目录加起来还不到5G.这是什么原因呢? 即便是有隐藏文件,查了也很小啊. 一.df和du ...

  6. linux 查看文件大小的命令

    1.查看虚拟机内存状态 df -hl 1 2.查看Linux目录大小 du -sh /* 1 3.查看当前目录下的总大小 du -sh 1 4.查看当前目录下的文件大小 du -sh /home/* ...

  7. Linux查看文件大小的简单指令

    文章目录 1.查看虚拟机内存状态 2.查看Linux目录大小 3.查看当前目录下的总大小 4.查看当前目录下的文件大小 5.ls 简单指令 5.1.查看隐藏文件(文件前缀带 点的) 5.2.当前目录下 ...

  8. Linux 查看文件大小

    1.最简单的查看方法可以使用ls -ll.ls-lh命令进行查看,当使用ls -ll,- 2.通过命令du -h –max-depth=1 *,可以查看当前目录下各文件.文件- 3.查询当前目录总大小 ...

  9. Linux查看文件大小的几种方法

    stat命令 stat filepath xanarry@ThinkPad:/$ stat ~/Downloads/jdk-8u60-linux-x64.tar.gzFile: '/home/xana ...

最新文章

  1. 努力成为优秀的工程师
  2. 没想到这家老牌AI公司越来越不“纯粹”了
  3. POJ 1470 Closest Common Ancestors (最近公共祖先LCA 的离线算法Tarjan)
  4. Jmeter工具笔记-Jmeter+influxdb+grafanas设置性能监控过程
  5. python离群点检测_如何从熊猫DataFrame中检测峰点(离群值)
  6. [浏览器]Apple之Safari 5.0.4
  7. linux删除几日的文件脚本,Windows Linux 删除N天之前文件脚本
  8. AX2009 VS平台报表开发学习笔记(一)--初体验
  9. mysql connectors层_mysql底层工作原理
  10. php 编译原理,php编译原理 - Robin3D的个人页面 - OSCHINA - 中文开源技术交流社区
  11. 第7章非线性系统的分析-7.1非线性系统的基本概念
  12. Oracle中针对中文进行排序
  13. 项目管理第十二章项目采购管理
  14. 程序人生 - 错过等一年!杭州人独属的惠民福利,还有最后三天
  15. 关于iis中域名转向的问题
  16. 拳皇重生服务器维护,《拳皇97 OL》3月8日更新维护公告
  17. 经典 CNN 神经网络 LeNet-5 的 C++ 实现(MNIST数据集)
  18. 【android逆向笔记】(二)滚动的天空逆向
  19. 详解活动图计算关键路径、最早开始时间、最晚开始时间、冗余时间,C++ 程序实现
  20. 【python】re解析和re模块

热门文章

  1. 西门子S7-1200介绍和编程及博图软件的安装使用
  2. centos7 杀不死 httpd (Apache )
  3. 2019计算机应用基础平时作业答案,2019年计算机应用基础作业一答案.docx
  4. 开眼角会不会留疤,开眼角术后疤痕增生怎么办
  5. C# 文字视频生成器
  6. 从REINFORCE到PPO,看Policy Gradient的前世今生
  7. Windows小技巧 -- 命令行窗口打开指定目录的资源管理器
  8. java excel 插入新行_excel:插入行更新公式
  9. android 发广播屏蔽home键,如何在Android App中屏蔽(拦截)Home按键及其他按键
  10. 【烈日炎炎战后端】 数据结构(0.7万字)