question on find -exec
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix administration > question on find -exec




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    question on find -exec  
Lu


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:10 PM

Hi,

I am trying to change some UID's. I googled around and found the
following command to use:
find / -user 1000 -print -exec chown -h 5000 {} \;
It worked great. But I don't understand what the "{} \;" does. Can
anyone tell me what that is?

Also, I tried to put it in a script, I got error message "missing
argument". What should I do to put it in scripts? Here's how it showed
up in the script:
#/bin/sh
find / -user 1000 -print -exec chown -h 5000 {} \\\;

Thanks a lot,

Lu





[ Post a follow-up to this message ]



    Re: question on find -exec  
Davide Bianchi


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:10 PM

Lu <lsun91125@yahoo.com> wrote:
quote:
> It worked great. But I don't understand what the "{} \;" does.
man find will tell, anyway the {} bit get subsituted with the file/directory find just found and \; means "here the previous command ends".
quote:
> Also, I tried to put it in a script, I got error message "missing > argument".
Do not escape the ''. Davide




[ Post a follow-up to this message ]



    Re: question on find -exec  
Lu


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:10 PM

Thanks a lot Davide. I made it to work in the script. I don't need any
more escape character.

Lu





[ Post a follow-up to this message ]



    Re: question on find -exec  
Bill Marcum


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:10 PM

On 8 Dec 2003 07:06:05 -0800, Lu
<lsun91125@yahoo.com> wrote:
quote:
> Hi, > > I am trying to change some UID's. I googled around and found the > following command to use: > find / -user 1000 -print -exec chown -h 5000 {} \; > It worked great. But I don't understand what the "{} \;" does. Can > anyone tell me what that is? >
man find Find replaces the {} with each filename that it finds, and the \; marks the end of the "-exec" arguments. -- Thanks to Nigeria, any email with the word "urgent" in the subject or address will be deleted.




[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:29 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register