Linux sortThe 'sort' command sorts the file content in an alphabetical order. Syntax: Example: Look at the above snapshot, the 'sort' command has sorted the file 'weeks.txt' in alphabetical order. To Sort A ColumnIf a file has more than one column, column number is used to sort a specific column. Syntax: Example: Look at the above snapshot, we have sorted column 1 and 2. Numeric SortingNumeric sorting is different from alphabetical sorting. For numeric sorting option 'n' is used along with the column number if required. Syntax: Example:
Next TopicLinux gzip
|