The sort command is used to sort the contents of a file. You can sort the data in a text file and display the output on the screen, or redirect it to a file. Based on your requirement, sort provides several command-line options for sorting data in a text file.
Syntax:
sort [options] filename
Examples:
#1 To sort text file [sort sort_file]

#2 To sort numbers in file, use -n option [sort -n sort_number_file]

#3 To sort months in file, use -M option [sort -M sort_month_file]

Refer below tables for more sort command options:
-b | Ignores leading spaces in each line |
-d | Uses dictionary sort order. Conisders only spaces and alphanumeric characters in sorting |
-f | Uses case insensitive sorting. |
-M | Sorts based on months. Either mention complete month name or only first 3 letters. Eg: JAN, FEB |
-n | Uses numeric sorting |
-R | Sorts the input file randomly. |
-r | Reverse order sorting |
-k | Sorts file based on the data in the specified field positions. |
-u | Suppresses duplicate lines |
-t | input field separator |
sed, short for "stream editor", allows you to filter and transform text. A stream editor is used to perform basic Read more
Cron is the system process that will automatically perform tasks for you according to a set schedule. The schedule is Read more
To extract archive file in Linux, you can use the tar command, used for extracting content from the archive files. "tar" Read more
chmod command is used to change the permission of a file in Linux. In Linux, there is a set of rules for Read more