LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 12-11-2005, 04:20 PM   #1
spiri
LQ Newbie
 
Registered: Dec 2003
Location: Portugal
Posts: 22

Rep: Reputation: 15
Unhappy Remove files w/ extension txt recursively


Hi,
I need to remove the files from a directory and their subdir with a extension.

I use to make the backups of all the customer disk to a samba share, then I
enter with bash and need to strip all exe, dll etc.
I try a lot of commands: rm *.exe /foo -Rf
but it doesn't work.

Any help with be very greatfull.

Regards,

spiri
 
Old 12-11-2005, 05:06 PM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Something like this....

find /some/directory -type f -name '*.exe' -exec rm {} \;
 
Old 12-11-2005, 05:56 PM   #3
spiri
LQ Newbie
 
Registered: Dec 2003
Location: Portugal
Posts: 22

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by homey
Something like this....

find /some/directory -type f -name '*.exe' -exec rm {} \;
Thanks,but it gives an error: find:missing argument '-exec'
 
Old 12-11-2005, 07:36 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,005
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Did you put that space between the curley-braces and the \;?


Cheers,
Tink
 
Old 12-14-2005, 04:52 AM   #5
spiri
LQ Newbie
 
Registered: Dec 2003
Location: Portugal
Posts: 22

Original Poster
Rep: Reputation: 15
Thats it buddy, the missing space.

Thanks a lot.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Strip / Remove attachments (Replace with TXT file if Possible) Vince0000 Linux - General 2 09-17-2010 07:46 PM
Remove directories recursively with same name cboyd Linux - Newbie 5 01-14-2007 10:48 PM
remove all files with same extension? scratchnz Linux - General 1 11-04-2005 04:40 AM
Txt extension file translation UltraSoul Solaris / OpenSolaris 3 05-21-2005 12:11 PM
how to rm backup files recursively wazoo Linux - Newbie 6 12-31-2004 11:03 AM


All times are GMT -5. The time now is 12:35 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration