Contents
How do I sort in Linux command?
Unix Sort Command with Examples
- sort -b: Ignore blanks at the start of the line.
- sort -r: Reverse the sorting order.
- sort -o: Specify the output file.
- sort -n: Use the numerical value to sort.
- sort -M: Sort as per the calendar month specified.
- sort -u: Suppress lines that repeat an earlier key.
18 февр. 2021 г.
How do I sort a column in Linux?
Use the -k option to sort on a certain column. For example, use “-k 2” to sort on the second column. Example : Suppose a file exists with a list of cars called cars.