On the Ubuntu-based machines I use at work, SIZE defaults to the ridiculously small 1MB. It’s somewhat hidden in the manpage: the documentation about the -S option doesn’t mention it, but later it says (bold added):
SIZE may be followed by the following multiplicative suffixes: % 1% of memory, b 1, K 1024 (default), and so on for M, G, T, P, E, Z, Y.
You can verify this by running seq 1 1000000000000 | sort and, while that’s happening, ls -lh /tmp/sort*.
I actually generally don’t want it to write its data to disk, because I’m usually using machines where the data fits very comfortably in RAM (data size is maybe up to 1GB) and writing to disk (even SSD) just adds slowness. Though splitting it unnecessarily also adds slowness. For my use case, specifying a much bigger buffer is appropriate.
Wow! That’s way too low for modern machines, especially since sort can query the environment to get a sense of how much memory it might be worth using.
On the Ubuntu-based machines I use at work, SIZE defaults to the ridiculously small 1MB. It’s somewhat hidden in the manpage: the documentation about the
-Soption doesn’t mention it, but later it says (bold added):You can verify this by running
seq 1 1000000000000 | sortand, while that’s happening,ls -lh /tmp/sort*.I actually generally don’t want it to write its data to disk, because I’m usually using machines where the data fits very comfortably in RAM (data size is maybe up to 1GB) and writing to disk (even SSD) just adds slowness. Though splitting it unnecessarily also adds slowness. For my use case, specifying a much bigger buffer is appropriate.
Wow! That’s way too low for modern machines, especially since
sortcan query the environment to get a sense of how much memory it might be worth using.