LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   how to delete *~ files created by rsync (https://www.linuxquestions.org/questions/linux-software-2/how-to-delete-%2A%7E-files-created-by-rsync-734838/)

cyrilng 06-22-2009 03:38 PM

how to delete *~ files created by rsync
 
Hello
i did some "rsync -avb dir1 dir2" and now on the destination directory there are some backupe files that end with ~
so i have twice some files on the destination dir
my question is :
how to erase all the files that end with ~ automatically?
I tried with "rm -rf *~" but it didn't work
thanks for the help

twantrd 06-22-2009 03:41 PM

Code:

rm -f ./*~
-twantrd

cyrilng 06-22-2009 03:49 PM

Quote:

Originally Posted by twantrd (Post 3582692)
Code:

rm -f ./*~
-twantrd

this doesn't work neither...
It's strange...

AlucardZero 06-22-2009 04:48 PM

WFM
Code:

alucard@karrde:/tmp$ touch a~
alucard@karrde:/tmp$ ls
a~  ip.cache  sage.log
alucard@karrde:/tmp$ ls -l
total 4
-rw-r--r-- 1 alucard alucard  0 2009-06-22 17:47 a~
-rw-r--r-- 1 root    root    15 2009-06-17 11:33 ip.cache
-rw-r--r-- 1 alucard alucard  0 2009-06-22 16:18 sage.log
alucard@karrde:/tmp$ rm -i a~
rm: remove regular empty file `a~'? y
alucard@karrde:/tmp$ ls -l
total 4
-rw-r--r-- 1 root    root    15 2009-06-17 11:33 ip.cache
-rw-r--r-- 1 alucard alucard  0 2009-06-22 16:18 sage.log

What does the rm command say when you use it?

twantrd 06-22-2009 05:39 PM

Try deleting it based on the inode number

Code:

[twantrd@twantrd test]$ ls -i *
58499 b~  58500 test
[twantrd@twantrd test]$ find . -inum 58499 -exec rm {} \;
[twantrd@twantrd test]$ ls
test
[twantrd@twantrd test]$


-twantrd

cyrilng 06-23-2009 01:04 AM

i managed to do it using "rsync -avz --delete dirsource dirdest"


All times are GMT -5. The time now is 10:46 AM.