Linux command - sort

  
        Name: sort location: /usr/bin/sort Permissions: All user usage: sort [OPTION]... [FILE]... sort [OPTION]... --files0-from=Foptions: -b -- Ignore-leading-blanks ignores the leading space -f --ignore-case fold lower case to upper case characters ignores the case of letters -M --month-sort compare (unknown) < `JAN' < ... < `DEC' Sort by month name

-n --numeric-sort compare according to string numerical value Sort by pure number (default by text type)


$ Cat a11325143$ sort a11133245$ sort -n a13451132 -u --unique In the same data, only one line $ cat a13513$ sort -u a135-t --field-separator=SEP use SEP instead of non-blank to blank transition Specify the separator, the default is TAB as the separator -k --key=POS1[,POS2] start a key at POS1 (origin 1), end it at POS2 (default end of line). See POS syntax below

< Br>

Specify the interval for sorting The first field row with the colon ":" as a separator


head /etc/passwdroot:x:0:0:root:/root:/bin/bashdaemon:x:1:1:daemon:/usr/sbin:/bin/Shbin:x:2:2:bin:/bin:/bin/shsys:x:3:3:sys:/dev:/bin/shsync:x:4:65534:sync:/bin:/bin/syncgames: x:5:60:games:/usr/games:/bin/shman:x:6:12:man:/var/cache/man:/bin/shlp:x:7:7:lp:/var/spool /lpd:/bin/shmail:x:8:8:mail:/var/mail:/bin/shnews:x:9:9:news:/var/spool/news:/bin/sh$ head /etc/Passwd
						
Copyright © Windows knowledge All Rights Reserved