On OS X, why does sudo ls show hidden files?

It is showing hidden files (that have names starting with a dot) when invoked by root and doesn’t show them (as expected) when running as a normal user. This differs from what ls on Linux (the one coming from coreutils) does.

Why does ls behave this way?

Very interesting answer. I love stuff like this.

29 Comments

  1. 2015-06-25 1:25 am
    • 2015-06-25 5:37 am
    • 2015-06-25 7:52 am
      • 2015-06-25 8:24 am
        • 2015-06-26 9:34 am
          • 2015-06-29 10:48 am
      • 2015-06-25 12:14 pm
        • 2015-06-25 2:16 pm
          • 2015-06-25 2:51 pm
          • 2015-06-25 3:37 pm
          • 2015-06-26 11:25 pm
          • 2015-06-27 8:45 am
      • 2015-06-25 1:40 pm
        • 2015-06-25 4:06 pm
          • 2015-06-25 4:36 pm
          • 2015-06-26 11:01 am
          • 2015-06-26 2:23 pm
      • 2015-06-25 2:13 pm
        • 2015-06-25 3:10 pm
          • 2015-06-25 4:04 pm
          • 2015-06-25 5:19 pm
          • 2015-06-25 5:56 pm
          • 2015-06-25 6:27 pm
          • 2015-06-25 8:23 pm
          • 2015-06-25 9:25 pm
          • 2015-06-28 12:07 pm
      • 2015-06-26 5:46 pm
  2. 2015-06-25 7:17 am
  3. 2015-06-25 6:54 pm