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()
Preface Let me share with you how to make a searc...
Most of this article refers to other tutorials on...
Table of contents 1. Software and system image 2....
It’s great to use CSS to realize various graphics...
The system environment is server2012 1. Download ...
Flex(彈性布局) in CSS can flexibly control the layout...
I believe everyone is familiar with the trashcan,...
1. Install Apache $ sudo apt update && su...
This article introduces common problems of Xshell...
1. Check the firewall status Check the firewall s...
This article example shares the specific code of ...
This article shares the specific code of jQuery t...
We live in a visual world and are surrounded by m...
Install mysql5.7 under win, for your reference, t...
Create a simple Spring boot web project Use the i...