0

ls sort alphabetically

char - ascii is 45

char 9 ascii is 57

so file - sort before 9

but why file 999-a sort after 9999a

$ ls -1
-
9
9999a
999-a
yuanjianpeng
  • 335
  • 1
  • 9
  • 1
    use `LC_ALL=C ls -1 9*`, see: https://stackoverflow.com/a/18451819/724039 – Luuk Nov 03 '22 at 07:36
  • Does this answer your question? [Sort 'ls' output by name](https://stackoverflow.com/questions/878249/sort-ls-output-by-name) – Luuk Nov 03 '22 at 16:24

0 Answers0