LinuxAnswers - the LQ Linux tutorial section.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 05-01-2008, 10:40 AM   #1
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, 10:45 AM   #2
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, 10:47 AM   #3
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, 11:19 AM   #4
Senior Member
Registered: Oct 2003
Posts: 2,397

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

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

instead of:

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


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
find commands shawniecas Linux - Newbie 4 06-14-2007 12:25 PM
piping commands blanny Linux - Newbie 4 07-26-2006 03:45 PM
Need help with commands and piping basselstine Linux - General 1 10-02-2005 10:43 PM
vim: Piping through multiple external commands tragos Linux - Software 2 03-19-2005 02:09 PM
piping commands john8675309 Linux - Software 3 12-06-2003 08:42 AM

All times are GMT -5. The time now is 07:47 AM.

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