Bash: Find files by extension, output to file using find
Published on 12 August 2019
I am searching for files by name criteria: the list of files that have the .h and .cpp extensions
$ find . -name '*.h' -o -name '*.cpp' + +
the list of files that have the .h and .cpp extensions
the result is saved in the file list_of_txt_files.list
$ find . -name '*.h' -o -name '*.cpp' -print > list_of_txt_files.list
I am looking for the list of files whose extension is .chm
And I destroy this list.
$ find . -name "*.chm" -type f -delete