If I use the ls
command in my home directory each line of output has a leading whitespace:
$ ls
bin Documents ...
It only seems to do this for my home directory.
Why does it do this?
Note: I don't consider this to be a duplicate of Why is 'ls' suddenly wrapping items with spaces in single quotes? because that's not what I asked and I'm not interested in knowing the answer. Simply knowing that the whitespace is a side-effect of the quoting sufficiently answers my question.
bin
directory have an actual space as the first character in its name? – Kusalananda Nov 21 '19 at 10:43ls
automatically quote some of the other filenames in the output due to them containing "special" characters? I can recreate this if I create any other filename with e.g. a space character in its name. GNUls
would then quote that name and indent other names in the directory listing output. – Kusalananda Nov 21 '19 at 10:45ls -l
. And it seems I have found the reason. One of the subdirectories contains a space and is quoted and it seems ls output reserves a column for the quote. I'll update my question. – StackedCrooked Nov 21 '19 at 10:48coreutils-8.31
installed on OpenBSD, I get the described behaviour by default with GNUls
, with no special aliases or anything. Withls -Q
, the indent is "used up" by the double quotes (which is use for every name), so you won't see it. I think--quoting-style=locale
is the default (which may possibly mean it's locale-dependent). – Kusalananda Nov 21 '19 at 11:07