Linux Sort command

Source: Internet
Author: User
Tags gopher

[[email protected]/]# sort order ^C[[email protected]/]# sort/etc/passwdadm:x:3:4: adm:/var/adm:/sbin/nologinbin:x:1:1: bin:/bin:/sbin/nologindaemon:x:2:2:d aemon:/sbin:/sbin/nologindbus:x:Bayi:Bayi: System Message bus:/:/sbin/nologinftp:x: -: -: FTP user:/var/ftp:/sbin/nologingames:x: A: -: games:/usr/games:/sbin/nologingopher:x: -: -: gopher:/var/gopher:/sbin/nologinhaldaemon:x: the: the: HAL daemon:/:/sbin/nologinhalt:x:7:0: halt:/sbin:/sbin/haltlp:x:4:7: lp:/var/spool/lpd:/sbin/nologinmail:x:8: A: mail:/var/spool/mail:/sbin/nologinnfsnobody:x:65534:65534: Anonymous NFS user:/var/lib/nfs:/sbin/nologinnobody:x: About: About: nobody:/:/sbin/Nologinoperator: x: One:0:operator:/root:/sbin/nologinpostfix:x: the: the::/var/spool/postfix:/sbin/nologinroot:x:0:0: root:/root:/bin/bashrpcuser:x: in: in: RPC Service user:/var/lib/nfs:/sbin/nologinrpc:x: +: +: Rpcbind daemon:/var/cache/rpcbind:/sbin/nologinsaslauth:x:499: the:"SASLAUTHD User":/var/empty/saslauth:/sbin/nologinshutdown:x:6:0: shutdown:/sbin:/sbin/shutdownsshd:x: About: About:P rivilege-separated ssh:/var/empty/sshd:/sbin/nologinsync:x:5:0: sync:/sbin:/bin/syncuucp:x:Ten: -: uucp:/var/spool/uucp:/sbin/nologinvcsa:x: the: the:VirtualConsole Memory owner:/dev:/sbin/nologinwanghaipeng:x:501:502::/home/wanghaipeng:/bin/bashwhp:x: -:501::/home/whp:/bin/Bash[[email protected]/]# sort-t:-k3/etc/passwdroot:x:0:0: root:/root:/bin/bashuucp:x:Ten: -: uucp:/var/spool/uucp:/sbin/Nologinoperator: x: One:0:operator:/root:/sbin/nologinbin:x:1:1: bin:/bin:/sbin/nologingames:x: A: -: games:/usr/games:/sbin/nologingopher:x: -: -: gopher:/var/gopher:/sbin/nologinftp:x: -: -: FTP user:/var/ftp:/sbin/nologindaemon:x:2:2:d aemon:/sbin:/sbin/nologinrpcuser:x: in: in: RPC Service user:/var/lib/nfs:/sbin/nologinrpc:x: +: +: Rpcbind daemon:/var/cache/rpcbind:/sbin/nologinadm:x:3:4: adm:/var/adm:/sbin/nologinlp:x:4:7: lp:/var/spool/lpd:/sbin/nologinsaslauth:x:499: the:"SASLAUTHD User":/var/empty/saslauth:/sbin/nologinwhp:x: -:501::/home/whp:/bin/bashwanghaipeng:x:501:502::/home/wanghaipeng:/bin/bashsync:x:5:0: sync:/sbin:/bin/syncshutdown:x:6:0: shutdown:/sbin:/sbin/shutdownnfsnobody:x:65534:65534: Anonymous NFS user:/var/lib/nfs:/sbin/nologinhaldaemon:x: the: the: HAL daemon:/:/sbin/nologinvcsa:x: the: the:VirtualConsole Memory owner:/dev:/sbin/nologinhalt:x:7:0: halt:/sbin:/sbin/haltsshd:x: About: About:P rivilege-separated ssh:/var/empty/sshd:/sbin/nologinmail:x:8: A: mail:/var/spool/mail:/sbin/nologindbus:x:Bayi:Bayi: System Message bus:/:/sbin/nologinpostfix:x: the: the::/var/spool/postfix:/sbin/nologinnobody:x: About: About: nobody:/:/sbin/Nologin[[email protected]/]# sort-t:-k3/etc/passwd segment Sort Colon split third paragraph ^C[[email protected]/]# sort-t:-k3,5-n/etc/passwd Interval Sort ^C[[email protected]/]# sort-t:-k3-n-r/etc/passwd Reverse ^C[[email protected]/]# Touch2. Txt[[email protected]/]# vim2. Txt[[email protected]/]# sort2. txt123456Adsfsdfsf[[email protected]/]# Sort-n-R2. txt654321Sdfsfdsfa[[email protected]/]# Sort-u2. txt ^C[[email protected]/]# Sort-u2. txt ^csort: Get file status failed (stat):^C: No file or directory [[email protected]/]# Sort-u2. txt sort to repeat ^C[[email protected]/]# vim2. Txt[[email protected]/]# Sort-un2. TXTSDFSF123456[[Email protected]/]# Cat2. txt123456SDFSFADSF123Asd[[email protected]/]#

Linux Sort command

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.