Working Principle of sort command note 01sort: compare each line of the file as a unit and compare each other. the comparison principle is to compare the lines following the first character by ASCII code, finally, output the result in ascending order 020304sort-u to remove the default sorting of the duplicate 05sort-rsort in the output... working Principle of sort command note 01sort: compare each line of the file as a unit and compare each other. the comparison principle is to compare the lines following the first character by ASCII code, finally, the results are output in ascending order 02 03 04 sort-u to remove the duplicated 05 sort-r sort from the output. the default sorting method is ascending, add-r to change it to descending order 06 sort-k 2 sort by the second string in each row of the file 07 sort-k 2-t: separate each line, then sort by the second character. 08 sort-k 1.2 sort sorts by the second letter p of the first string. 09 sort-k 1.2, 1.2-k 2, 2nr sort is sorted in ascending order based on the second letter of the first string. if they are equal, the second string is sorted in descending order by 10 11.
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.