Help - Search - Members - Calendar
Full Version: how can i write cp -R without need to give back yes fro replaced files
The Planet Forums > Operating Systems > Red Hat Linux
FrederickVI
how can i write it


i remeber something feedback=yes but not remeber how to write it

cp -R feedback=yes * /xxxx/


for not need give yes respponse for replacements

thank you
LighthousePoint
as cp --help quickly shows:

cp -Rf source destination
FrederickVI
but there is more than that f

there is a command extension you can put after the -R like response=yes


for example if i use your comand it gives that response


root@ns1 [/restore/home]# copy -Rf * /home2/
cp: overwrite `/home2/absolut/public_html/_vti_pvt/frontpg.lck'?
smack
The f means "force" and is the same thing as --force. It will not prompt to overwrite.
smack
Just tested it. You sure you have the command right?
FrederickVI
cp -R reply=yes /x/x /x/x

that is it
LighthousePoint
Why do you post in the forum if you do not wish to listen?
ScottPO
The `yes` command floods stdout with a whole bunch of y's.

If you don't want to to say y, then give the yes command a parameter, maybe n is what you want . . .

`yes n` will print a crap load of n's to the screen. Okay, so how is this useful? Well, just pipe it to that command that you want to keep on tell yes to, or no to.

Yes, the command for when yes really means yes icon_smile.gif

working example

yes | cp -R * /backup
FrederickVI
thanks you understand what i mean

diiferent permissions produce -f is not working

so i dont want deal with that...

you may try it with different permissions...

yes i know i can preserve permissons but i wish not preserver them!!!

simply two night ago i write a command like in order

cp -r "i dont know here maybe reply=yes" * * /etc

it is worked... i try search for it... i am not master and i try to listen everything... but my ssh is infront of me and even i do not here i try that -f extension ... chmod or chwod in those no promt come... but in cp... yes... there is promt if a permission issue

maybe i am so dumb... but what i need just simple as that...

thanks all


AND THIS IS NOT WORKING VERSION
root@ns1 [/restore/home/mykoc]# cp -Rf * /home/mykoc
cp: overwrite `/home/mykoc/mail/inbox'?

AND THIS IS WORKING VERSION

but with this version it gives reply in the screen

in two days ago i found no reply in the screen
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.