All Questions
7 questions
4
votes
2
answers
211
views
Why is ls sorting Chinese filenames by length?
I've run into a bit of a weird behaviour that I don't fully understand with ls and Chinese filenames. I'm running macOS 13.6.1 with SIP enabled (no core OS modifications), MacPorts installed, and US ...
3
votes
1
answer
158
views
Sorting ls output respecting locale but not ignoring nonalphanumeric characters
Let's say I have a directory with the files _b, a, c, č, d. I would like to sort the files according to the cs_CZ.UTF8 locale but without ignoring the underscore, ie like this: _b a c č d.
Currently, ...
4
votes
2
answers
2k
views
Why does `ls` list the following files in seemingly different orders?
Why does ls list the following files in seemingly different orders?
By default, doesn't ls list files in the lexicographical order for my current locale, which I guess is the default one?
$ ls
a_1 ...
1
vote
1
answer
302
views
Is `ls -l` sorting files unintuitively?
Let me explain considering this output of ls -l met*:
% ll met*
-rw-rw-r--. 1 polemon polemon 20K 09-20 04:24 met_gs.png
-rw-rw-r--. 1 polemon polemon 20K 09-20 04:26 met_idx.png
-rw-rw-r--. 1 ...
7
votes
2
answers
4k
views
sort and ls -- why aren't capitalized letters sorted first?
I want a sorting like this, with capitalized letters before lowercase:
-rw-r--r--. 1 0 0 183 2014-10-14 20:17 ./CHECKSUMS.md5
-rw-r--r--. 1 0 0 185 2014-10-14 20:17 ./CHECKSUMS.asc
drwxr-xr-x....
6
votes
1
answer
583
views
Alphabetizing names in `ls` alias with .files not intermingled
I am currently using the following ls alias: alias ls='ls -alhGkpsq --color=auto'. This results in following directory listing.
[03:35] bryson@brys ~ :$ ls
total 48K
4.0K drwx------ 4 bryson 4.0K ...
35
votes
4
answers
22k
views
How do I make ls sort underscore characters first?
I like being able to name files and directories with an underscore prefix if it's something I want to keep separate from other files and directories at the same level. On Windows and Mac, for example, ...