Linux: Multi delete files by extension

2019, February, 24

LinuxHow-ToCode

Linux command to delete all files of a specific extension from current and all child folders

find . -type f -name '*.<EXTENSION>' -delete
  • find - linux command to search for files in a directory hierarchy
  • . - for current directory
  • -type f - search for files
  • -name - name pattern to find files
  • -delete - Operation for selected files

for example,

find . -type f -name '*.srt' -delete