Linux / Unix - Find And List All Hidden Files Recursively

Linux / Unix - Find And List All Hidden Files Recursively

To find and list all hidden files in a directory and its subdirectories (recursively) in Linux or Unix, you can use the find command with the -name option.

For example, to find and list all hidden files in the current directory and its subdirectories, you can use the following command:

find . -name ".*"
Source‮al.www:‬utturi.com

This will search the current directory (.) and all of its subdirectories for files with names that begin with a dot (.*).

You can also use the -type f option to search for only regular files (not directories).

For example:

find . -name ".*" -type f

This will search the current directory and all of its subdirectories for hidden regular files.

To search for hidden files in a specific directory, you can specify the directory path in place of the . character.

For example, to find and list all hidden files in the directory /path/to/dir and its subdirectories, you can use the following command:

find /path/to/dir -name ".*" -type f

This will search the specified directory and all of its subdirectories for hidden regular files.

Keep in mind that the find command is recursive by default, so it will search all subdirectories of the specified directory for hidden files.

You can also use the -print option to print the names of the found files to the screen.

For example:

find . -name ".*" -type f -print

This will search the current directory and all of its subdirectories for hidden regular files and print the names of the found files to the screen.

Note: In Unix and Linux, hidden files are files that have names that begin with a dot (.). These files are usually configuration files or files that are not meant to be accessed directly by users.

Created Time:2017-10-29 22:08:57  Author:lautturi