Are you aware that locales exist? In the collation sequence of the POSIX locale the tilde is actually near the end.
↧
Comment by Kamil Maciorowski on What is the full alphabetical order used on Linux and similar OSes?
↧