How to show only hidden files in Terminal?
I have a directory that contains thousands of files, some of them are hidden.
The command ls -a
list all files, including hidden ones, but I need just to list hidden files.
What command should I use?
The command :
ls -ld .?*
Will only list hidden files .
Explain :
-l use a long listing format
-d, --directory
list directory entries instead of contents, and do not derefer‐
ence symbolic links
.?* will only state hidden files
ls -d .!(|.)
Does exactly what OP is looking for .