Skip to main content
nerdbynature
  • Archives
  • Tags
  • RSS feed
  • Atom feed
  • Imprint
  • Source

/bin/ls --wtf

2016-09-17 03:09

Source

So, I noticed this:

$ env -i /bin/bash                 # Clear the environment
$ touch foo bar\ baz               # Creates two files, "foo" 
                                   # and "bar baz"
$ ls -1
'bar baz'
foo
Why is ls(1) suddenly quoting filenames that contain spaces? After a bit of digging, this commit introduced this change into GNU/coreutils, but at least Debian is on the case and fixed it in their version:
$ ls
bar baz
foo

$ ls --quoting-style=shell
'bar baz'
foo
  • bits
  • Previous post
  • Next post
Contents © 2023 - Powered by Nikola