LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-22-2009, 03:38 PM   #1
cyrilng
LQ Newbie
 
Registered: Oct 2007
Distribution: debian lenny
Posts: 24

Rep: Reputation: 15
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
 
Old 06-22-2009, 03:41 PM   #2
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
Code:
rm -f ./*~
-twantrd
 
Old 06-22-2009, 03:49 PM   #3
cyrilng
LQ Newbie
 
Registered: Oct 2007
Distribution: debian lenny
Posts: 24

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by twantrd View Post
Code:
rm -f ./*~
-twantrd
this doesn't work neither...
It's strange...
 
Old 06-22-2009, 04:48 PM   #4
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
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?
 
Old 06-22-2009, 05:39 PM   #5
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
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
 
Old 06-23-2009, 01:04 AM   #6
cyrilng
LQ Newbie
 
Registered: Oct 2007
Distribution: debian lenny
Posts: 24

Original Poster
Rep: Reputation: 15
i managed to do it using "rsync -avz --delete dirsource dirdest"
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Based on what condition, will rsync delete files? edenCC Linux - Software 6 04-09-2009 01:21 AM
rsync not delete non existing files on remote server proNick Linux - Software 2 09-10-2008 03:47 AM
ow do I delete all files which were created on a specific date marsguy Linux - General 9 08-21-2007 08:15 AM
can't delete a folder that I created. randell6564 Ubuntu 32 08-18-2006 02:14 AM
If I delete files are new ones created?? BajaNick Linux - Software 1 07-06-2004 11:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration