Linux ETC

ls 명령어의 파일 사이즈 쉽게 확인하기

ls 의 스위치 옵션 -h (--human-readable) 를 이용하면 KB/MB/GB 단위로 쉽게 파일 사이즈 확인이 가능하다.

[HOSTWAY] /home > # ls -alh
total 312G
drwxr-xr-x.  6 root      root      4.0K Oct 22 23:16 .
drwxrwxrwt  25 root      root      4.0K Oct 22 09:36 ..
-rw-r--r--   1 root      root       98G Oct 23 13:07 100GB_LUN01
-rw-r--r--   1 root      root      200G Oct 23 13:07 200GB_LUN01
drwx------.  2 root      root       16K Oct 13  2011 lost+found
drwxr-xr-x   3 root      root      4.0K Feb 28  2012 svn
-rw-r--r--   1 root      root      9.8G Nov 11  2011 SWAP_FILE

또한, -S 스위치 옵션을 사용하면, 사이즈로 descending 정렬이 가능하다.

[HOSTWAY] /home > # ls -alSh
total 312G
-rw-r--r--   1 root      root      200G Oct 23 13:07 200GB_LUN01
-rw-r--r--   1 root      root       98G Oct 23 13:07 100GB_LUN01
-rw-r--r--   1 root      root      9.8G Nov 11  2011 SWAP_FILE
drwx------.  2 root      root       16K Oct 13  2011 lost+found
drwxr-xr-x.  6 root      root      4.0K Oct 22 23:16 .
drwxrwxrwt  25 root      root      4.0K Oct 22 09:36 ..
drwxr-xr-x   3 root      root      4.0K Feb 28  2012 svn


번호 제목 글쓴이 날짜 조회 수
6 grub 사용방법 sylee 2008.05.15 28374
5 nmap 사용법 sylee 2008.05.15 29307
4 find 명령 1 sylee 2008.05.14 25983
3 ssh 포트 변경 방법 sylee 2008.05.14 31257
2 head 와 tail 사용하기 sylee 2008.05.14 63483
1 가용할 수 있는 물리적 메모리를 최대한 이용해봅시다. hostway 2008.05.14 26669