# A Bash one-liner to find and remove backup files

DevFeed: [A Bash one-liner to find and remove backup files](<https://devfeed.tech/articles/my-favorite-bash-oneliner-37315.md>)

Original publisher: [Read original article](<https://muffinman.io/blog/my-favorite-bash-oneliner/>)

Author: Stanko

Published: 2016-04-04T00:00:00Z

Content type: tutorial

Language: en

Sources: [Stanko Tadić](<https://devfeed.tech/sources/stanko-tadic.md>)

Topics: [Scripting, bash](<https://devfeed.tech/topics/scripting-bash.md>), [Bash](<https://devfeed.tech/topics/bash.md>), [file](<https://devfeed.tech/topics/file.md>)

Tags: [bash](<https://devfeed.tech/tags/bash.md>), [command](<https://devfeed.tech/tags/command.md>), [file](<https://devfeed.tech/tags/file.md>), [files](<https://devfeed.tech/tags/files.md>)

## AI overview

A Bash one-liner recursively finds files matching the *~ pattern, removes them with rm, and prints the affected files. The command and its file pattern can be customized.

## Source excerpt

This simple bash command finds all of the files matching *~ recursively, executes rm on them and prints out which files are affected. You can replace file matching pattern, and command you want to execute. find ./ -name '*~' -exec rm '{}' ';' -print