Sort effect and usage:
Sort [-option] file name
NAME
Sort-sort lines of text files sort display
Sort by default sorted by ASCA code table
-N: Sort from small to large by value size
-r: Sorted in descending order and can be used with-N.
-T: Specifies the field delimiter;-T: for field separators
-K: Which field to sort the keywords in;-k3 to sort by the third field
-U: The same row is only displayed once after sorting
-F: Ignore character capitalization when sorting
[Email protected] test]# sort-t:-k3-n/etc/passwd
Root:x:0:0:root:/root:/bin/bash
Bin:x:1:1:bin:/bin:/sbin/nologin
Daemon:x:2:2:daemon:/sbin:/sbin/nologin
Adm:x:3:4:adm:/var/adm:/sbin/nologin
Lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
Sync:x:5:0:sync:/sbin:/bin/sync
Shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
This article is from the "Learn Linux history" blog, please be sure to keep this source http://woyaoxuelinux.blog.51cto.com/5663865/1859387
Linux Text Processing command--sort