This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Help for batch cleaning *autosave & *~ backup files

Tags: None
(comma "," separated)
User avatar
Deevad
Registered Member
Posts
451
Karma
1
OS
Image

Anyone know a bit a "terminal bash magic" command line to clean all this files on all a files tree recursively ?

I collected a lot of autosave and ~ files ( witch is nice and secure from Krita ) and I'm open to all solution of easy/lasy cleaning. o)


User avatar
google01103
Manager
Posts
6668
Karma
25
see http://www.cyberciti.biz/faq/linux-unix ... ove-files/ & http://www.linuxquestions.org/questions ... ns-261595/ obviously test using the -print option to ensure the multiple pattens work

test with
Code: Select all
find . \( -name "*.autosave" -o -name "*~"  \) -print


Code: Select all
find . \( -name "*.autosave" -o -name "*~"  \) -exec rm -rf {} \;


OpenSuse Leap 42.1 x64, Plasma 5.x

slangkamp
KDE Developer
Posts
607
Karma
4
find -name "*autosave" | xargs rm & find -name "*~" | xargs rm
User avatar
google01103
Manager
Posts
6668
Karma
25
or
Code: Select all
find . \( -name "*.autosave" -o -name "*~"  \) -delete
never saw the -delete option referenced before but it is included in the man page


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar
Deevad
Registered Member
Posts
451
Karma
1
OS
Thanks to both. That worked great, and I could get a direction to look at and learn from the man page. A lot of time saved ( and 8 GB ! ) , and a clean result.

I finally used this , mixing both of your posts :
Code: Select all
find -name "*~" -delete
find -name "*autosave" -delete


and had the comfort to saw if all was ok before with :
Code: Select all
find -name "*~" -print
find -name "*autosave" -print




Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]