How to descend into all subdirectories and delete all files matching a pattern?

The latest in my set of asked questions. If you’re like me, and paranoid about r-syncing, you end up with loads of backup~, backup~~, backup~~~ and backup~~~~ files. Every now and again, usually after a backup to disc, it’s time to delete them.

find ./ -name '*~' | xargs rm

works, but produces an ugly error message. I’ve also followed a suggestion and created my own simple script to clean these files out.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: