find – display only files starting with . (hidden) – Unix & Linux Stack Exchange
Posted by jpluimers on 2020/08/21
find . -type f -name '\.*' -printMust work if you want list every hidden file down in the directory hierarchy.
This sort of works on Linux, but fails on VMware ESXi (on Linux it only works when applying -maxdepth 1, deeper levels fails because they list all files where the top directory starts with a .):
If you want hidden files and hidden directories, without . and .. :find -regex '\./\..+' -print
This works on both Linux and VMware ESXi:
If you want hidden files and hidden directories, without . and .. :
find . \( -type f -o -type d \) -name '\.*' -print
Based on:
- [WayBack] find – display only files starting with . (hidden) – Unix & Linux Stack Exchange
- [WayBack] shell – `find -name` pattern that matches multiple patterns – Stack Overflow
–jeroen






Leave a comment