공학박사 권경안

sort 명령어를 통해 파일사이즈별로 리스트하기 본문

Programming/UNIX

sort 명령어를 통해 파일사이즈별로 리스트하기

Karl Kwon 2009. 4. 22. 14:16
LISTING FILES BY SIZE

If you want to have a listing of the
files sorted by size, you can use the
following command(s), it will list
the files in decrease order. if you
need to do the same thing recursively,
you could use the second one.

ls -l | grep ^- | sort -nr -k 5 | more
ls -lR | grep ^- | sort -nr -k 5 | more


@ 응용해서 현재 디렉토리부터 서브티렉토리 까지 전부 찾으면서 가장큰사이즈가 큰녀석을 asc 하게 리스트하기.

find ./ -name *.log | xargs ll -tr | sort -n -k 5


'Programming > UNIX' 카테고리의 다른 글

UNIX - Shell 어제 날짜 구하기  (0) 2009.05.29
UNIX - ln (link files and directories)  (0) 2009.05.06
UNIX grep Command  (0) 2009.02.10
UNIX bdf 명령어  (0) 2009.02.02
UNIX cut 명령어  (2) 2009.01.29