Created
November 30, 2014 17:48
-
-
Save ksdev-pl/2a64ef2c9d88b3e9a179 to your computer and use it in GitHub Desktop.
Revisions
-
ksdev-pl created this gist
Nov 30, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ To remove multiple files such as *.jpg or *.sh with one command find, use: `find . -name "FILE-TO-FIND" -exec rm -rf {} \;` OR `find . -type f -name "FILE-TO-FIND" -exec rm -f {} \;` The only difference between above two syntax is that the first command remove directories as well where second command only removes files. Options: * `-name "FILE-TO-FIND"` : File pattern. * `-exec rm -rf {} \;` : Delete all files matched by file pattern. * `-type f` : Only match files and do not include directory names.