LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-01-2008, 09:40 AM   #1
hugene
LQ Newbie
 
Registered: Dec 2007
Posts: 19

Rep: Reputation: 0
Piping find or ls with rm commands


Hello all,

I want to remove just a set of files from a directory, I am trying the following command:

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

I get an error:
rm: missing operand
Try `rm --help' for more information.
rm: missing operand
Try `rm --help' for more information.
rm: missing operand
.....

where each file name (that I want deleted) should have been.

I am running Suse.

Why isn't the return of the find command returned into {}?

Thanks a lot
 
Old 05-01-2008, 09:45 AM   #2
beadyallen
Member
 
Registered: Mar 2008
Location: UK
Distribution: Fedora, Gentoo
Posts: 209

Rep: Reputation: 36
Put a space between {} and \; Then it should work.
 
Old 05-01-2008, 09:47 AM   #3
hugene
LQ Newbie
 
Registered: Dec 2007
Posts: 19

Original Poster
Rep: Reputation: 0
hehehe thank you very much, who would have thought.
 
Old 05-01-2008, 10:19 AM   #4
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,989

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
There should be a space between the last } and the \; like so:

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

instead of:

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


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
find commands shawniecas Linux - Newbie 4 06-14-2007 11:25 AM
piping commands blanny Linux - Newbie 4 07-26-2006 02:45 PM
Need help with commands and piping basselstine Linux - General 1 10-02-2005 09:43 PM
vim: Piping through multiple external commands tragos Linux - Software 2 03-19-2005 01:09 PM
piping commands john8675309 Linux - Software 3 12-06-2003 07:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:27 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
Open Source Consulting | Domain Registration