/bin/ls output does not match manpage
The order is determined by the collation sequence of your locale.
Ex. in my default locale (which is en_CA.UTF-8
)
$ ls -A1
a
.b
c
whereas in the C
locale
$ LC_COLLATE=C ls -A1
.b
a
c
(I used -A
instead of -a
to eliminate the .
and ..
directories).
Another way to get the order you want might be to use the -v
(version sort) option as suggested in Grouping hidden files and directories with ls - although that's not really what it is intended for:
-v natural sort of (version) numbers within text
Since ls
is almost certainly already aliased inside your .bashrc
file, you could simply modify the alias(es) there to include the -v
.