Skip to content

Instantly share code, notes, and snippets.

@chibby0ne
Last active May 16, 2018 06:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chibby0ne/1764434319830dd06af5a5415cec2483 to your computer and use it in GitHub Desktop.
Save chibby0ne/1764434319830dd06af5a5415cec2483 to your computer and use it in GitHub Desktop.
Find all hidden files of a certain extension in the curent directory recursively

This command will find all the files of the given extensions in the current directory recursively, print the output to console and also write it to list_of_hidden_files file in the current directory:

find . -regextype posix-extended -regex ".*\.(EXTENSIONS)" | tee list_of_hidden_files 

where EXTENSION can be any regex expression:

For example to look for .docx, doc, and odt just replace extensions for:

docx|doc|odt

Eg.:

find . -regextype posix-extended -regex ".*\.(docx|doc|odt)" | tee list_of_hidden_files 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment