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 10-11-2006, 08:40 AM   #1
dc144
LQ Newbie
 
Registered: Sep 2006
Posts: 5

Rep: Reputation: 0
find -exec help


Hi All,

I am trying to use the find command to find files not modified for more than 5 minutes and move the file(s) to another dir. But the error is missing argument to '-exec'


find . -mmin +5 -type f -exec mv {} mydir \;
find: missing argument to `-exec'


What did I miss out? Please help.
Thanks
 
Old 10-11-2006, 09:55 AM   #2
michux
Member
 
Registered: Nov 2004
Location: Warsaw, Poland
Distribution: Ubuntu
Posts: 76

Rep: Reputation: 15
Quote:
Originally Posted by dc144
Hi All,

I am trying to use the find command to find files not modified for more than 5 minutes and move the file(s) to another dir. But the error is missing argument to '-exec'


find . -mmin +5 -type f -exec mv {} mydir \;
find: missing argument to `-exec'


What did I miss out? Please help.
Thanks
I tried the same command on my box and it.. worked
At least it did not produce an error message.

Perhaps try something like:
Code:
find . -mmin +5 -type f -exec 'mv {} mydir' \;
and check ifthat helps...
 
Old 10-11-2006, 09:55 AM   #3
berbae
Member
 
Registered: Jul 2005
Location: France
Distribution: Arch Linux
Posts: 540

Rep: Reputation: Disabled
I don't see exactly what the word 'mydir' stands for :
An environment variable, a real directory, or what ?
 
Old 10-12-2006, 02:14 AM   #4
dc144
LQ Newbie
 
Registered: Sep 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks michux,
Now there's a new progress but still not working
with the single quote '', the message is

find: mv myfile mydir: no such file or directory


berbae, mydir is just a directory I created.
 
  


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 01:27 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