发表于: lnmp | 作者: | 日期: 2013/3/21 05:03
标签:

使用参数h来以K、M、G为单位显示文件大小。
h参数的说明如下:

-h, –human-readable
print sizes in human readable format (e.g., 1K 234M 2G)

以下是一个示例:

[root@ZZ-Nginx ~]# ls -lh
total 1.8G
-rw-r–r– 1 root root 1.3M Jul 11 2012 20120710.tar.gz
drwxr-xr-x 2 root root 4.0K Aug 1 2012 aa
-rw——- 1 root root 956 May 21 2012 anaconda-ks.cfg
drwxr-xr-x 2 root root 4.0K Nov 26 16:43 backup
drwxr-xr-x 3 root root 4.0K Feb 3 23:56 bak
drwxr-xr-x 2 root root 4.0K Jul 24 2012 bin
-rw-r–r– 1 root root 544K Jul 18 2012 cacti-0.8.7i.zip
-rw-r–r– 1 root root 22K May 30 2012 check_lm_sensors-3.1.1-0.noarch.rpm
-rwxr-xr-x 1 root root 2.6K Jul 10 2012 check_network
-rw-r–r– 1 root root 9.2M Jan 21 10:40 dump.tar.gz
-rw-r–r– 1 root root 493K Mar 19 10:25 hs_err_pid21420.log
-rw-r–r– 1 root root 30K May 21 2012 install.log
-rw-r–r– 1 root root 3.4K May 21 2012 install.log.syslog
-rw-r–r– 1 root root 1.1M Jul 3 2012 mrtg-2.17.4.tar.tar
-rw——- 1 root root 1.3G Mar 19 16:06 mydump.bin
drwxrwxrwx 16 post root 4.0K May 25 2012 nagios-plugins-1.4.15
-rw-r–r– 1 root root 2.0M Apr 10 2012 nagios-plugins-1.4.15.tar.gz
drwxr-xr-x 8 www www 4.0K May 25 2012 nrpe-2.13
-rw-r–r– 1 root root 403K Apr 13 2012 nrpe-2.13.tar.gz
-rw-r–r– 1 root root 28K Jul 9 2012 perl-Cache-Memcached-1.29-1.el5.rf.noarch.rpm
-rw-r–r– 1 root root 2.9M May 11 2012 pnp4nagios-0.6.17.tar.gz
-rw-r–r– 1 root root 406M Jan 21 13:18 poster.tar.gz
-rw-r–r– 1 root root 21M Feb 4 15:44 rcm-server.war
-rw-r–r– 1 root root 363K Mar 19 16:06 sums.txt
drwxr-xr-x 4 root root 4.0K Jul 11 2012 test
-rw-r–r– 1 root root 2.9M Jul 11 2012 test.tar.gz

: https://blog.darkmi.com/2013/03/21/3198.html

本文相关评论 - 1条评论都没有呢
Post a comment now » 本文目前不可评论

No comments yet.

Sorry, the comment form is closed at this time.