Best Answer: How Do I Sort Large Files in Linux?
Contents How Do I Sort Large Files? the Only Viable Option for Sorting Very Large Files Efficiently Is to Split Them, Sort the Individual Parts in Parallel and...
Contents
How do I sort large files?
The only viable option for sorting very large files efficiently is to split them, sort the individual parts in parallel and merge them. This splits the input file into chunks of 100000 lines.
Must Read
How do I sort files by size in Unix?
To list all files and sort them by size, use the -S option. By default, it displays output in descending order (biggest to smallest in size). You can output the file sizes in human-readable format by adding the -h option as shown. And to sort in reverse order, add the -r flag as follows.