Portal Home > Knowledgebase > Articles Database > howto : copy index.shtml to folders in one command ..


howto : copy index.shtml to folders in one command ..




Posted by E-Learning, 11-25-2007, 09:25 AM
hello ... i would like to copy index.shtml to these folder in 1 command ... i mean to let index.shtml index uploads and themes .....etc in 1 command .

Posted by Steve_Arm, 11-25-2007, 09:30 AM
Still not clear what you want to do.

Posted by Tom P, 11-25-2007, 09:31 AM
Try this out Hope this is what you were looking for! - Tom

Posted by E-Learning, 11-25-2007, 09:31 AM
Steve i want to copy the index.shtml page to all these folders ... am in wp-content folder ... so what command to copy this file intro all these files in one command !

Posted by E-Learning, 11-25-2007, 09:33 AM
doesn't work !

Posted by Tom P, 11-25-2007, 09:49 AM
Wow sorry, I had a really dumb moment there... I'm not sure how you would do that, just read through the copy command and it looks like it doesn't support it. You could put all the commands on 1 line by joining them but not sure if you can do it in one command. Would be easy to write a bash script to do it though

Posted by E-Learning, 11-25-2007, 09:52 AM
mmmmmm i think that 2 ... thanks alot ..

Posted by Steve_Arm, 11-25-2007, 10:02 AM
Like: for i in gallery photos plugins themes do cp index.shtml $i/index.shtml end

Posted by AttackerNET, 11-25-2007, 10:50 AM
cp -af index.shtml */ That's all. Regards,

Posted by Tom P, 11-25-2007, 11:01 AM
Sys Admin: The problem with that is it will copy that file to every dir, and doing it with specified dirs doesn't work either. I've made a simple bash script for you, use it with care as it doesn't have any checking. Usage: mcp sourcefile destination destination destination Example: mcp index.shtml uploads/ themes/ plugins/ Add that to a file, call it mcp (or what ever you choose) and give it executable permissions. If you can put it in one of your path directories otherwise you can put it in the same directory and call it by using ./mcp instead.

Posted by AttackerNET, 11-25-2007, 11:08 AM
He said he want to copy it to all dir's. He wrote: "i mean to let index.shtml index uploads and themes .....etc in 1 command ." I guess, etc = the other folders as well..he have 6 dirs only he can use whatever method depends on his needs. Thanks

Posted by Tom P, 11-25-2007, 11:10 AM
Yeah, E-learning you weren't very clear about exactly what you wanted. At least now you have a couple of solutions at your disposal

Posted by E-Learning, 11-25-2007, 03:10 PM
thanks alot guys ... sorry i mean the indexs.html Sys_admin ... but am sorry for my pure english ... Thanks alot guys



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Google MXrecord (Views: 502)