| Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
12-05-2008, 03:22 AM
|
#1
|
|
LQ Newbie
Registered: Mar 2005
Posts: 3
Rep:
|
Copying single file to multiple locations
I've hunted all over for this but only find similar yet unworkable solutions.
I have a file: favicon.ico that I want to copy into the location of all the other favicon.ico files in the /var/www directory tree.
There's over 150 sites in there so I want to do this without resorting to manually copying to each one.
I thought I could do a find then exec but hat doesn't seem to work.
Any ideas?
|
|
|
|
12-05-2008, 03:59 AM
|
#2
|
|
Member
Registered: Oct 2002
Location: Delft, Netherlands
Distribution: Gentoo
Posts: 196
Rep:
|
This works for me:
Code:
find /var/www -name favicon.ico -exec cp /path/to/favicon.ico \{\} \;
|
|
|
|
12-05-2008, 04:22 AM
|
#3
|
|
Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
What's the meaning of \{\} as opposed to {}?
Just out of interest.
|
|
|
|
12-05-2008, 05:13 AM
|
#4
|
|
Member
Registered: Oct 2002
Location: Delft, Netherlands
Distribution: Gentoo
Posts: 196
Rep:
|
I think I had problems with some shell that 'interpreted' the '{'. I might be wrong though, don't remember exactly  .
@Ashiro: this means that it might work as:
Code:
find /var/www -name favicon.ico -exec cp /path/to/favicon.ico {} \;
|
|
|
|
12-05-2008, 05:50 AM
|
#5
|
|
Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
I haven't tried anything on this, but it occurred to me that you may need to add "-f" to "cp", since you want to force replacement.
vladmihaisima, thanks for the clarification.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting 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
|
|
|
All times are GMT -5. The time now is 05:38 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|