3 ms·
ls does not show files starting with .
by pvg 8y ago
ls does not show files starting with .
- binarysaurus 8y agoBut there is a driving purpose behind that, hidden vs non-hidden is binary. With so many media formats I agree that consistency is very important.
- ndnxhs 8y agoThe reason is because it was a lazy hack to hide . and .. from ls and then people started using this behaviour to hide files.
- pvg 8y agoIt's still largely arbitrary. I'm pushing back against the general notion that standard Unix-y command line tools are some shining example of consistency. Most of it is just us confusing familiarity for consistency.
- Wowfunhappy 8y agoThere are some edge cases, but those cases are well-known and simple to understand.
- pvg 8y agoIf you haven't run across it before, google up The Unix-Haters Handbook for an entertaining book-length rebuttal.
- hn_throwaway_99 8y agoYeah, but those files are known as "hidden files". In other words, it is the creators of those files who purposefully prepend them with a . to hide them from ls and other tools. One can argue whether this "starting with a . means hidden" is a hack or not, but I think it's manifestly different than not showing particular file types based on size or something like that. I agree just not showing pdf files by default because they render slowly is a design mistake.
- pvg 8y agoThe thing I'm getting at is not whether one behaviour or another is 'right' - just that they are both inconsistent so in this case 'consistency' is probably not the right design criterion on which to base this criticism.
- tobinfricke 8y ago> One can argue whether this "starting with a . means hidden" is a hack or not The story from Rob Pike is that this came about from a combination of (1) not wanting to show "." and "..", and (2) some sloppy programming in the implementation of that feature. https://plus.google.com/+RobPikeTheHuman/posts/R58WgWwN9jp https://plus.google.com/+RobPikeTheHuman/posts/R58WgWwN9jp