Thousands of lines are nothing. GNU sort can process millions if not billions. It automatically uses temporary files to not run short of RAM.

Your experience with grep is weird. As far as I understand, grep's memory requirement do not depend on the number of lines (which could be infinite). It processes one single line, outputs it if and only if it matches the regular expression, then forgets about it to process the subsequent line and so on.

Reply via email to