To list only hidden files:
ls -ap | grep -v / | grep -e "^\." To list only hidden directories:
ls -ap | grep -e "^\..*/$" ls -aplists everything in the current directory, including hidden ones, and puts a/at the end of directories.grep -v /inverts results ofgrep /, so that no directory is included."^\..*/$"matches everything that start with.and end in/.