I want to list only the files and folders that are hidden (starting with dot). When I use the command
ls .??*
I get the output
.gitignore
.git:
COMMIT_EDITMSG FETCH_HEAD HEAD ORIG_HEAD branches config description hooks index info logs objects packed-refs refs
I don't want the content in the folder. Instead I'm looking for the output which only lists the folders
.gitignore
.git [different color for the folders, like the normal ls]
try:
ls -d .*
fyi
-d, --directory
list directories themselves, not their contents
if your ls is not alias of other command, the output of above ls -d .*
will output files/dirs in same line. If you want to have them each in its own line:
ls -d1 .*
if you want colored output:
ls -d1 --color=auto .*