Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

{}\;

Status
Not open for further replies.

waryaa

Instructor
Dec 2, 2001
5
US
HI GUYS

find / -name core -exec cp {} \;

what is the meaning {} \; ?
why should I use {} \; ?
can some explain me more detailed way?

thanks
waryaa


 
I use a similar thing "find / -name core -exec rm {} \; "
which executes the rm command on the list of files (core) that are
found by the find.
 
The {} is the filename found by the find command
And the \; is to tell the exec command that is the end of
the command ; is short for enter and \ escapes the command
so it is not caught by the shell. Tony ... aka chgwhat

When in doubt,,, Power out...
 
For your command to work, you will need to put in a file name to copy the found core files to. Something like:

find . -name core -exec {} core.old \;

should do the trick.

Cheers.
 
THAT'S WONDERFULL REPLY
THANKS ALOT
I APPRECIATED FOR EDUCATION.



WARYAA
 
Monday mornings eh?

My post above should have read:

find . -name core -exec cp {} core.old \;

of course! Apologies.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top