6 ms·
On OS X, why does sudo ls show hidden (dot) files?
- bksta 11y agoroot ls always shows dotfiles on BSD
- Someone 11y agoNot, as the top scoring answer shows, in November 1977. Mundane question, interesting answer.
- frou_dh 11y agoPer Rob Pike, the very existence of "hidden" named dotfiles was a bug that snowballed: https://plus.google.com/+RobPikeTheHuman/posts/R58WgWwN9jp https://plus.google.com/+RobPikeTheHuman/posts/R58WgWwN9jp
- tehaugmenter 11y agoThis 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.
- droopyEyelids 11y agoI know it's difficult, but you should start using more descriptive words instead of 'retarded'. I personally don't care, but a lot of people end up holding it against us retarded-sayers.
- tehaugmenter 11y agoYeah from time to time it's hard to remember how much harsher HN is with comments compared to reddit.
- abc_lisper 11y agoDamn!
- ossreality 11y agoTHAT is why ~/ gets so littered? :(
- RexRollman 11y agoThat'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.
- darkr 11y agoThe 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.
- DougBTX 11y agoThat takes about eight months of practice apparently. https://m.youtube.com/watch?v=MFzDaBzBlL0 https://m.youtube.com/watch?v=MFzDaBzBlL0
- function_seven 11y agoOnly if you're an adult! :)
- ars 11y agoThat's an awesome video! Slightly worried about his son though :)
- jpgvm 11y agoThis video is amazing.
- agumonkey 11y agoSo much in so few time. ps: just remembered that we had a lazy day in primary school where teachers brought asymetric bikes of all kinds (oval wheels, tilted, etc). No inverted direction though. pps: how long would it take to learn new patterns with training wheels ?
- eru 11y agoProbably longer. Might be less frustrating for some people, though.
- 11y ago
- segmondy 11y agoFor security reasons. Nothing should be hidden from root.
- bradleyland 11y agoIt'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.
- abrowne 11y agoThat was my thought too. It answered how and when, not why.
- fl0wenol 11y agoIf the why was ever recorded anywhere, it would have been in the comments of the code when it was committed, because it wasn't explained in the documentation or anywhere else other than: "it does this". Either that or a email/USENET discussion from that time period; but those aren't so easily retrieved unless you were originally involved in that ancient discussion. It's worth the effort to document going to the source to see if any insights code be unearthed, even if it doesn't reveal much, just so that others know what has already been explored and to look/ask elsewhere if this is not a sufficient background. I think the logic to the why has been lost to time. We might talk about why it would or wouldn't be a good idea for a modern version of ls; it's something to give a few moments' thought, but no more.
- vacri 11y agoIt does do the 'why', in a way. Why does the OSX ls do -foo-? Well, because the source OS did it that way. It wasn't a decision by the OSX people, but inherited.
- kazinator 11y agoAlso here: http://unix.stackexchange.com/questions/211689/sudo-ls-not-showing-hidden-files-on-linux/211701#211701 http://unix.stackexchange.com/questions/211689/sudo-ls-not-s...
- azernik 11y agoCode archaeology needs to become an actual academic discipline.
- hobarrera 11y agoAFAIK, 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 11y ago> 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.
- hobarrera 11y ago> This is incorrect, and the linked question actually mentions this… Actually it mentions how this comes from BSD, which is a direct descendant of Unix. > This differs from what ls on Linux (the one coming from coreutils) does. Linux is not Unix. > Anything that good hackers would find interesting. It's amusing that the default behaviour of ls would be interesting to hackings.
- trippy_biscuits 11y agoWhy can no one read a man page anymore? They even have them on the internet these days. https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/ls.1.html https://developer.apple.com/library/mac/documentation/Darwin... -A List all entries except for . and ... Always set for the super-user.
- wdr1 11y agoThat doesn't really explain the history of why. I think that's the most interesting part of the answer.