Tugqi Biz
  • Home
  • Categories
  • Tags
  • Archives

Shell 代码片段

-hl 参数¶

ls -hl
-h, --human-readable
    with -l, print sizes in human readable format (e.g., 1K 234M 2G)
$ df -hl
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda5        92G   20G   68G  23% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
udev            2.9G  4.0K  2.9G   1% /dev
tmpfs           584M  1.3M  582M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            2.9G   21M  2.9G   1% /run/shm
none            100M   32K  100M   1% /run/user

man命令比help更可阅读¶

shell: count files in dir¶

ls -1 | wc -l

shell: size of dir¶

du -hl dir/

Automatically Create Recursive Directory¶

mkdir -p exist/notexist


  • « TLCL 看书笔记(3)
  • Python 代码片段 »

Published

Mar 30, 2015

Category

IT

Tags

  • Shell 4
  • Snippets 4
  • Powered by Pelican. Theme: Elegant by Talha Mansoor