How do I sort lines in Linux?
Answer
Sort lines of a text file
Answer
Sort lines of a text file
- To sort the file in alphabetical order, we can use the sort command without any options:
- To sort in reverse, we can use the -r option:
- We can also sort on the column. For example, we will create a file with the following text:
- Blank space is the default field separator.