LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 11-29-2005, 06:34 AM   #1
arvin_shu
LQ Newbie
 
Registered: Nov 2005
Distribution: red hat 9
Posts: 3

Rep: Reputation: 0
Question redhat 9.0 how to use the command 'find' with the action -exec


I was a very beginner who just entering the linux world.

now I have one question

under bash

i don't know how to use 'find'

#find /home -user tom -exec cp -a {} /tmp

i want to copy the files which belongs to Tom to /tmp, but when i use the above command , the bash tells me:
missing arguments to '-exec'

how can i do?
 
Old 11-29-2005, 07:31 AM   #2
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,644

Rep: Reputation: 145Reputation: 145
Re: redhat 9.0 how to use the command 'find' with the action -exec

Quote:
Originally posted by arvin_shu

find /home -user tom -exec cp -a {} /tmp \;

You were just missing the "\;" at the end. I think this should work.
 
Old 11-29-2005, 07:40 AM   #3
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,644

Rep: Reputation: 145Reputation: 145
If you want to learn to use commands in the console and much more, the rute tutorial is a great starting point: http://rute.2038bug.com/index.html.gz
It contains many examples and explanations from which you can start your own expeditions
 
Old 11-30-2005, 07:09 AM   #4
arvin_shu
LQ Newbie
 
Registered: Nov 2005
Distribution: red hat 9
Posts: 3

Original Poster
Rep: Reputation: 0
thanks a lot, it works.

now i'm learning the regular expression, it confuse me a lot.
need more time to handle.
 
  


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
how can I execute two commands on exec of a find? eantoranz Programming 3 08-03-2010 04:51 PM
find: missing argument to `-exec' pavodive Linux - Newbie 4 10-05-2009 02:24 PM
Help sought with 'find -exec' drjones69 Linux - Software 2 04-27-2005 04:02 AM
find -exec question eantoranz Linux - General 1 06-26-2004 10:57 AM
find -exec cricbk Linux - Newbie 4 01-05-2004 07:03 PM

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

All times are GMT -5. The time now is 12:32 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