The sort command is very commonly used, but it also has many parameters, such as: -o, -n, -u, -r, and you may not be able to remember how to use it at the moment. Here is a question that can be well combined with the above parameters to achieve a good memory effect. Title: The data file data contains the following data: 4 1 3 5 1001 2 4 5 Please use one command to reverse the sort, remove duplicates and save the data in the data file as well. Final output:
To achieve the above three requirements, we need to use the above parameters at the same time. The specific commands are as follows: [root@localhost ~]# cat data | sort -nur -o data 1001 5 4 3 2 1 Remark:
Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links You may also be interested in:
|
<<: CocosCreator Getting Started Tutorial: Network Communication
>>: Detailed explanation of the order of Mysql query results according to the order of ID in in()
sshd SSH is the abbreviation of Secure Shell, whi...
Table of contents What is a trigger Create a trig...
This article shares the 6 most effective methods,...
This article will not explain the use and install...
Effect: First create five vue interfaces 1.home.v...
Background requirements: As the business grows la...
<br />I am very happy to participate in this...
Preface Relational databases are more likely to b...
This article shares the specific code of React to...
This article introduces RHEL8 network services an...
1. MySQL's own stress testing tool - Mysqlsla...
MySQL trigger syntax details: A trigger is a spec...
jQuery form validation example / including userna...
Note: In web development, after adding autocomplet...
Table of contents Web Development 1. Overview of ...