리눅스 ll 자연정렬, 버전정렬 -v

(리눅스 ll 자연정렬에서 넘어옴)

1 개요[ | ]

리눅스 ll 자연정렬, 버전정렬
  • -v 옵션을 붙이면 된다.
또는 --sort=version이라고 써도 된다.
  • 여기서는 v는 버전(version)
메이저/마이너 버전까지 정렬을 할 수 있다.

2 예시 1[ | ]

ll (기본 예시)
root@web2:/tmp/natsort# ll
total 8
drwxr-xr-x 2 root root 4096 Dec  4 22:23 ./
drwxrwxrwt 8 root root 4096 Dec  4 22:22 ../
-rw-r--r-- 1 root root    0 Dec  4 22:22 10.txt
-rw-r--r-- 1 root root    0 Dec  4 22:22 11.txt
-rw-r--r-- 1 root root    0 Dec  4 22:23 12.txt
-rw-r--r-- 1 root root    0 Dec  4 22:22 8.txt
-rw-r--r-- 1 root root    0 Dec  4 22:22 9.txt
→ 그냥 실행하면 10번대가 앞으로 가는 사전식 정렬
ll -v (자연정렬 예시)
root@zetawiki:/tmp/natsort# ll -v
total 8
drwxr-xr-x 2 root root 4096 Dec  4 22:23 ./
drwxrwxrwt 8 root root 4096 Dec  4 22:22 ../
-rw-r--r-- 1 root root    0 Dec  4 22:22 8.txt
-rw-r--r-- 1 root root    0 Dec  4 22:22 9.txt
-rw-r--r-- 1 root root    0 Dec  4 22:22 10.txt
-rw-r--r-- 1 root root    0 Dec  4 22:22 11.txt
-rw-r--r-- 1 root root    0 Dec  4 22:23 12.txt
-v 옵션을 붙이면 10번대가 뒤에 오는 자연 정렬

3 예시 2[ | ]

ll (기본 예시)
root@zetawiki:/tmp/versort# ll
total 8
drwxr-xr-x  2 root root 4096 Dec  4 22:32 ./
drwxrwxrwt 10 root root 4096 Dec  4 22:31 ../
-rw-r--r--  1 root root    0 Dec  4 22:31 hello.10.10.10.txt
-rw-r--r--  1 root root    0 Dec  4 22:32 hello.10.9.11.txt
-rw-r--r--  1 root root    0 Dec  4 22:32 hello.11.11.11.txt
-rw-r--r--  1 root root    0 Dec  4 22:32 hello.9.11.9.txt
-rw-r--r--  1 root root    0 Dec  4 22:32 hello.9.9.9.txt
ll -v (버전정렬 예시)
root@zetawiki:/tmp/versort# ll -v
total 8
drwxr-xr-x  2 root root 4096 Dec  4 22:32 ./
drwxrwxrwt 10 root root 4096 Dec  4 22:31 ../
-rw-r--r--  1 root root    0 Dec  4 22:32 hello.9.9.9.txt
-rw-r--r--  1 root root    0 Dec  4 22:32 hello.9.11.9.txt
-rw-r--r--  1 root root    0 Dec  4 22:32 hello.10.9.11.txt
-rw-r--r--  1 root root    0 Dec  4 22:31 hello.10.10.10.txt
-rw-r--r--  1 root root    0 Dec  4 22:32 hello.11.11.11.txt
→ 버전별로 차곡차곡 정리되었다.

4 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}