I was looking for a way to show only hidden files (files with names preceded by a period) when I use the ls command, and I came across the solution today. Of course, we all know how to show hidden files like this:
CODE:
“ls -a” or
“ls -all”
BUT WAIT! Can’t we show ONLY hidden files? Well, my friend, if that’s what you’re looking for, then you’ve come to the right place. Let me show you how:
CODE:
ls -ld .??*
Yep, it appears that it’s really that simple. Hope this helps someone else who’s needing to find two simple hidden files in a folder with over 1,900 high quality digital images of a candy factory. Or something like that.
Thanks!
thanks, very useful!
Thanks mate!
I have seen many others using grep for doing this but this is clearly the right way!
Years of using *nix and until now I know how to achieve this.
thanks a lot.
ls -ld .??* only list hidden files whose name are 3 bytes or longer.
ls -A .* | grep ‘^\.’ does the work.
Actually ‘ls -d .*’ leaves you with a much simpler printout.
You’ve got to be trippin’, njtuneguy. Ok, that was a bad joke — LS….D? Hehe.
It actually is a great alternative if you don’t need any file/directory info. Thanks for the comment!
just try this l.
a l and a dot after it.
How about this: ls -ld .*
what purpose does this blog post serve in the first place???
why would anybody want to list only hidden files?
http://3.bp.blogspot.com/-OvK1m45x-58/TkQvMyEBfNI/AAAAAAAADvg/qgwOhEsODRA/s400/confusion.jpg
Seriously ‘ninja’? How about when you’re looking for hidden files and don’t want to sift through all the normal files, there are a million and one use cases for this.
thank u
It doesn’t work.
ls -ld .??* gives: “No such file or directory”
ls -ld .* gives: “-bash: How: command not found”