top | item 9774645

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

124 points| Zirro | 10 years ago |superuser.com | reply

36 comments

order
[+] darkr|10 years ago|reply
The problem with such thoroughly robust StackOverflow answers as this; when I stumble across one as I occasionally do, so taken aback am I by it's succinct completeness that it becomes irreversably embedded into my limited brain space.

I am afraid that one day I will come across an answer so comprehensive I will forget how to ride a bicycle.

[+] ketralnis|10 years ago|reply
I often do feel that way about especially thorough material, but this just says "it's that way because it's always been that way"
[+] frou_dh|10 years ago|reply
Per Rob Pike, the very existence of "hidden" named dotfiles was a bug that snowballed: https://plus.google.com/+RobPikeTheHuman/posts/R58WgWwN9jp
[+] RexRollman|10 years ago|reply
That's interesting because in playing with 9Front (Plan9) yesterday, I noticed that rc's ls doesn't ignore dotfiles. I guess they fixed it there.
[+] tehaugmenter|10 years ago|reply
This is certainly interesting. Too bad it doesn't suffer from the same robustness the stackoverflow link had.

I for one get frustrated at work, using git on windows, when I try to create a .gitignore file or something of the sort and windows bitches at me saying "You must type a file name". At least there are easy workarounds for it, but explorer is just retarded.

[+] azernik|10 years ago|reply
Code archaeology needs to become an actual academic discipline.
[+] segmondy|10 years ago|reply
For security reasons. Nothing should be hidden from root.
[+] bradleyland|10 years ago|reply
It's interesting to me the contrast between what the question of "why" means to different people. The answer on Superuser is wonderfully well researched, and very complete, but does it really answer the question? I guess it depends on your perspective.

Imagine you are in standing in a bedroom, and someone asks you, "Why are you in this bedroom?"

Does you answer look like this?

"I walked in through the front door, passed through the living room, down the hall, then used the door to enter this room."

Or like this?

"I was feeling kind of sleepy, so I figured I'd come in here and lie down on the bed."

The former is not a perfect analogue for the Superuser answer, but perfect analogues are difficult to come by.

[+] bksta|10 years ago|reply
root ls always shows dotfiles on BSD
[+] Someone|10 years ago|reply
Not, as the top scoring answer shows, in November 1977. Mundane question, interesting answer.
[+] hobarrera|10 years ago|reply
AFAIK, this is standard on any Unix platform, not just OS X. I also fail to see why this is news, this behaviour is decades old.
[+] deathanatos|10 years ago|reply
> AFAIK, this is standard on any Unix platform, not just OS X.

This is incorrect, and the linked question actually mentions this…

> This differs from what ls on Linux (the one coming from coreutils) does.

> I also fail to see why this is news, this behaviour is decades old.

Straight from the guidelines,

> On-Topic: Anything that good hackers would find interesting. That includes more than hacking and startups. If you had to reduce it to a sentence, the answer might be: anything that gratifies one's intellectual curiosity.

I found it interesting, as the behavior surprises me, and I had no idea BSD ls did this.