In our last article we have covered various examples on sort command, if you’ve missed, you can go through it using below link. In continuation to the last post this post aims at covering remaining of sort command so that both the article together serves as complete guide to Linux ‘sort‘ command.
Before we continue further, create a text file ‘month.txt‘ and populate it with the data as given below.
15. Sort the file ‘month.txt‘ on the basis of month order by using switch ‘M‘ (–month-sort).
Important: Note that ‘sort‘ command needs at least 3 characters to consider month name.
16. Sort the data that is in human readable format say 1K, 2M, 3G, 2T, where K,M,G,T represents Kilo, Mega, Giga, Tera.
17. In the last article we have created a file ‘sorted.txt‘ in example number 4 and another text file ‘lsl.txt‘ in example number 6. We know ‘sorted.txt‘ is already sorted while ‘lsl.txt‘ is not. Lets check both the files are sorted or not using sort command.
No comments:
Post a Comment