Some time ago, I ran into the problem of having a very large comma-separated-value file which I had to sort. There are many good solutions for this simple problem, and there are many ways of going about this in general. The better ones probably being, loading the file into Sqlite or a docker with Postgresql and using SQL. Or adapting the data with a quick python script to make it easy to use Unix's sort.