The sort
command sorts the files and outputs the sorted results. The sort
command can either manipulate files or get it from stdin
.
Syntax format: sort [parameter] [file]
Common parameters:
Example
# 读取文件test.py的每一行,相互比较,依次ASCII码值进行比较,按升序输出sort test.py # 忽略相同行sort -u test.py
This article is reprinted from https://xugaoxiang.com/2022/06/26/linux-cmds-79-sort/
This site is for inclusion only, and the copyright belongs to the original author.