This article mainly writes the use of some shell script sort and uniq tools in Linux environments.
Sort is a tool for sorting the contents of files in units of lines, and can also be sorted according to different data types.
Sort the accounts in the /etc/passwd file
sort -t ‘:’ -k 3 /etc/passwd -o user.txt
The uniq tool is usually used in conjunction with the sort command to report or ignore duplicate lines in the file.