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()
Table of contents 1. Simple to use 2. Use DISTINC...
Both methods can be used to execute a piece of ja...
Hello everyone, today we will talk about how to u...
Table of contents Preface Core code File shows pa...
Preface During the stress test, if the most direc...
<br />Original text: http://andymao.com/andy...
Recently, I have done a simple study on the data ...
Table of contents 1. A simplest server-side examp...
Html code: Copy code The code is as follows: <t...
js date time format Convert the date and time to ...
1. Run the .sh file You can run it directly using...
MySQL-Group-Replication is a new feature develope...
Table of contents Preface need accomplish First R...
The office needs Ubuntu system as the Linux devel...
Preface MySQL version 8.0.23 adds a new feature: ...