Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
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 ...
nneonneo's user avatar
  • 1,188
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, ...
Nikola Benes's user avatar
1 vote
1 answer
2k views

How can I get and set the locale used by `ls`?

When run in bash, ls by default sort output files by a lexicographical order wrt the current locale. Is the locale a property belonging to bash, ls, or my OS Ubuntu? How can I get and set the locale?...
Tim's user avatar
  • 105k
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 ...
Tim's user avatar
  • 105k
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 ...
polemon's user avatar
  • 11.7k
32 votes
5 answers
8k views

How can I make “ls” show dotfiles first while staying case-insensitive?

Create the following files in a directory. $ touch .a .b a b A B 你好嗎 My default ls order ignores the presence of leading dots, intermingling them with the other files. $ ls -Al total 0 -rw-r--r-- 1 ...
Sparhawk's user avatar
  • 20.3k
4 votes
1 answer
6k views

Question marks instead of national letters in console

I have Netgear Stora MS2000 (which uses a modified version of Red Hat) and have strange font issues while connecting by SSH. Note that this occurs both when connecting by PuTTY from Windows and by ...
bpiec's user avatar
  • 151
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....
elbarna's user avatar
  • 13.2k
2 votes
1 answer
874 views

Linux ls wrong date format

I try to find why when I do the command ls or whatever ls -la the column format is wrong with date. It should be like that: -rw-r--r-- 1 johndoe johndoe 55 janv. 26 2011 not like that : drwxr-...
user60314's user avatar
3 votes
2 answers
3k views

dot instead of comma as thousand separator

I read about --blocksize for ls to get a thousands separator. However my computer gives me dot (.) and not comma (,): $ ls -l --block-size="'1" total 11.893.190.656 -rw------- 1 carlah users 1.081....
Carla's user avatar
  • 33
5 votes
2 answers
2k views

'ls -l' file timestamp format

When I issue the command: ls -l The file/directory modification timestamp column (specifically the month part) is displayed in the native language of the country I'm based in instead of English. ...
jukon's user avatar
  • 53
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 ...
Bryson's user avatar
  • 212
18 votes
3 answers
6k views

Output ls -l size field with digits grouped by thousands?

It is possible to make ls -l output the size field with digits grouped by thousands? If so, how? For instance: $ ls -l -rw-rw---- 1 dahl dahl 43,210,052 2012-01-01 21:52 test.py (Note the commas in ...
Roger Dahl's user avatar
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, ...
Tom Auger's user avatar
  • 654