I want to list all hidden files and directories and then save result to file.Is there any command for this?
How to recursively list all hidden files and directories?
files;directory
If using GNU find, you can dofind /path -path '*/.*' -ls | tee output-fileEditTo avoid to show non-hidden items contained in hidden directoriesfind /path -name '.*' >output-file(as noted, tee could be avoided if you do not need to see the output, and -ls option should be used only if required).