A detailed description of the sort command

Source: Internet
Author: User
Sort is a very common command in Linux that compares each line of a file as a unit, comparing it from the first character backwards to the ASCII value, and finally outputting them in ascending order. Here is a file test with the contents: 8723 23423321324 21343223 234123 231234 1234654 3452341. The-t option for sort and the-k option sort provide the-t option, after which you can set the spacer,-K to specify the number of columns. Sorts the first column sort test to sort the second column Sort-k 2 test If you change the contents of the test file to: 8723, 23423321324,21343223,234123,231234,1234654,345234 If you want to sort the second column by size Sort-t&n


1. About the use of the sort command in Linux

Summary: Sort is a very common command in Linux, each line of the file as a unit, compared to each other, the comparison principle is from the first character backwards, followed by the ASCII value of the comparison, and finally he

"Related question and answer recommendation":

How does the sort command under Linux-windows sort by value?

Related Article

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.