Showing posts with label How to list only hidden files in UNIX. Show all posts
Showing posts with label How to list only hidden files in UNIX. Show all posts

Friday, September 28, 2012

How to list only hidden files in UNIX?

ls -1A | grep '^\.'

Eg:


[vjsujay@cheetah:/home/vjsujay]#ls -1A | grep '^\.'
.profile
.recently-used
.sh_history
.softwareupdate
.ssh
[vjsujay@cheetah:/home/vjsujay]#

[vjsujay@cheetah:/home/vjsujay]#ls -1a | grep '^\.'
.
..
.profile
.recently-used
.sh_history
.softwareupdate
.ssh
[vjsujay@cheetah:/home/vjsujay]#


FYI.

-a will list hidden files along with default directories single dot(.) and double-dot(..)
-A will list hidden files without single dot and double dot