I know how to delete recursively all files with a specific extension, but how about if that extension has a number appended to it?

For example, how can I delete files named .d3plot1, .d3plot2, .d3plot4, etc.

Thank you for your suggestions.

$ find /path/ -type f -name "*.d3plot*" -print -exec rm -f {} \;
| improve this answer | |

please try:

sudo rm -f ./*.d3plot*
| improve this answer | |
  • Wow, that worked. Thank you!! – Johnny OMAS Dec 19 '19 at 21:54
  • 2
    sudo seems like it could be overkill here – jesse_b Dec 19 '19 at 22:08
  • 1
    What makes this recursive? – Kusalananda Dec 20 '19 at 0:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.