-   Linux - Newbie (
-   -   find trouble ( 07-21-2005 12:22 AM

find trouble

I have the following mount structure,

/dev/hdc9 ext3 /
/dev/hdc6 vfat /home/chandru/data

I have two files as below,


from /home/chandru, when I execute,

find . -name *~ -exec rm {} \;

the file "techo~" is not removed, but "tmpfile~" is removed.

However, when I run the same command from the same directory for a second time, "techo~" is removed.

What should I do remove both files simultaneously??

Basically, I want to remove all backup files created by emacs under "/home/chandru".

Michael Johnson 07-21-2005 02:14 AM

Try this syntax
find . -name *~ -exec rm '{}' \;
NOTE the single quotes. 07-21-2005 06:03 AM

I'm sorry!

That did not help!!

jkobrien 07-21-2005 06:32 AM

Double quotes around *~, I think.


find . -name "*~" -exec rm {} \;

John 07-21-2005 06:39 AM


That worked out. But y do I need the double quotes when there are no spaces in the file names?

jkobrien 07-21-2005 06:46 AM

I think it's the wild-card (*). That expands to a list and how that will be handled depends on your shell.

John 07-21-2005 07:10 AM

Thanks for the explanation

All times are GMT -5. The time now is 02:51 PM.