The sort
command line is used to sort files and print the results line by line. It can also be used to remove duplicate lines from a file.
Here are examples of common uses of this command:
file.txt
and print the result to the terminal:sort file.txt
file.txt
and write the result to the file output.txt
:sort file.txt -o output.txt
file.txt
and print the result to the terminal:sort -f file.txt
file.txt
and print the result to the terminal:sort -n file.txt
file.txt
and print the result to the terminal:sort -u file.txt
file.txt
and print the result to the terminal:sort -t ',' file.txt