Posts Tagged ‘xargs’

Remove backup files ending with “~” from your system.

May 1, 2013 4 comments

Many text editors create backup files with names ending with “~”.

Most of the times these files are annoying and unnecessary…

So, you can use the following piped commands to remove them :

find / | grep "^.*~$"
       | sed -e 's/\(^.*$\)/"\1"/g'
       | xargs rm -f > /dev/null 2>&1

Please take account that this version handles correctly also filepaths containing space characters.