2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Linux] ls -lhでファイルサイズをわかりやすく表示する

Posted at

普通にls -lを打つとバイト単位で表示されてわかりにくい

[root@localhost ~]# ls -l /
合計 32
lrwxrwxrwx.   1 root root     7  5月 11 23:40 bin -> usr/bin
dr-xr-xr-x.   5 root root  4096  8月 27 21:42 boot
drwxr-xr-x.  20 root root  3160  9月  2 21:33 dev
drwxr-xr-x. 152 root root 12288  9月  2 21:33 etc
drwxr-xr-x.   4 root root    30  8月 27 21:28 home
lrwxrwxrwx.   1 root root     7  5月 11 23:40 lib -> usr/lib
lrwxrwxrwx.   1 root root     9  5月 11 23:40 lib64 -> usr/lib64
drwxr-xr-x.   2 root root     6  4月 11  2018 media
drwxr-xr-x.   2 root root     6  4月 11  2018 mnt
drwxr-xr-x.   3 root root    16  5月 11 23:42 opt
dr-xr-xr-x. 137 root root     0  9月  2 21:33 proc
dr-xr-x---.  14 root root  4096  7月 17 23:00 root
drwxr-xr-x.  41 root root  1300  9月  2 21:33 run
lrwxrwxrwx.   1 root root     8  5月 11 23:40 sbin -> usr/sbin
drwxr-xr-x.   2 root root     6  4月 11  2018 srv
dr-xr-xr-x.  13 root root     0  9月  2 21:33 sys
drwxrwxrwt.  12 root root  4096  9月  2 21:34 tmp
drwxr-xr-x.  13 root root   155  5月 11 23:40 usr
drwxr-xr-x.  23 root root  4096  7月 13 18:57 var

ls -lhオプションをつければgood

[root@localhost ~]# ls -lh /
合計 32K
lrwxrwxrwx.   1 root root    7  5月 11 23:40 bin -> usr/bin
dr-xr-xr-x.   5 root root 4.0K  8月 27 21:42 boot
drwxr-xr-x.  20 root root 3.1K  9月  2 21:33 dev
drwxr-xr-x. 152 root root  12K  9月  2 21:33 etc
drwxr-xr-x.   4 root root   30  8月 27 21:28 home
lrwxrwxrwx.   1 root root    7  5月 11 23:40 lib -> usr/lib
lrwxrwxrwx.   1 root root    9  5月 11 23:40 lib64 -> usr/lib64
drwxr-xr-x.   2 root root    6  4月 11  2018 media
drwxr-xr-x.   2 root root    6  4月 11  2018 mnt
drwxr-xr-x.   3 root root   16  5月 11 23:42 opt
dr-xr-xr-x. 134 root root    0  9月  2 21:33 proc
dr-xr-x---.  14 root root 4.0K  7月 17 23:00 root
drwxr-xr-x.  41 root root 1.3K  9月  2 21:33 run
lrwxrwxrwx.   1 root root    8  5月 11 23:40 sbin -> usr/sbin
drwxr-xr-x.   2 root root    6  4月 11  2018 srv
dr-xr-xr-x.  13 root root    0  9月  2 21:33 sys
drwxrwxrwt.  10 root root 4.0K  9月  2 21:35 tmp
drwxr-xr-x.  13 root root  155  5月 11 23:40 usr
drwxr-xr-x.  23 root root 4.0K  7月 13 18:57 var
2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?