Find and remove files
Using the find
command:
find dir-name criteria action
To remove multiple files, for example *.jpg
, or *.sh
, use:
find . -type f -name "*.jpg" -exec rm -rf {} \;
To remove matching directories as well as files, remove the -type f
flag.