Ask a normal sort to order 1.2.0, 1.9.2 and 1.10.0 and it will happily put 1.10.0 first. It compares character by character, and “1” comes before “2”. That’s correct for text and wrong for anything with a version number in it.
GNU sort has a fix built in. -V (long form --version-sort) treats every run of digits inside the text as a number:
printf '%s\n' 1.10.0 1.9.2 1.2.0 | sort -V
That prints 1.2.0, 1.9.2 and then 1.10.0, which is what a human expects. It works on whole names too, not just bare numbers, so a folder of files like backup-1.9.tar.gz and backup-1.10.tar.gz comes out in the right order. Combined with tail it gives you the newest one:
ls backup-*.tar.gz | sort -V | tail -n 1
I’d reach for this whenever I compare release tags in a script, or when kernel or image version lists look shuffled. It’s also handy for numbered files without leading zeros, like part2 and part10, where a plain sort would put part10 first.
One thing to know: -V still looks at the whole line, starting at the first character. If the version sits in a later column, for example the second field of some tool’s output, give it as a key modifier instead, as in sort -k2,2V. Sort accepts V next to n, r and the other one-letter options on a key, and that keeps the version logic on the one column where it belongs. And it’s a GNU option, so check that the sort on the machine you’re scripting for is the GNU one before you count on it.
Further reading: GNU sort invocation, sort(1) manual page