便利なオプション -h
普通にlsを使ってファイル一覧を表示してもファイルサイズがよくわかりません。
- ls -l
- total 565796
- -rw-r--r-- 1 root root 184070144 Jul 19 01:07 file1
- -rw-r--r-- 1 root root 70737920 Jul 19 01:07 file2
- -rw-r--r-- 1 root root 323973120 Jul 19 01:07 file3
しかしオプションで-hをつけるとKB、MB、GBなどわかりやすい単位にしてくれます。
- ls -lh
- total 553M
- -rw-r--r-- 1 root root 176M Jul 19 01:07 file1
- -rw-r--r-- 1 root root 68M Jul 19 01:07 file2
- -rw-r--r-- 1 root root 309M Jul 19 01:07 file3
このオプションはほかにも、df、duにも使用できます。