Click to See Complete Forum and Search --> : cp - how to 'force' w/o questions?
brasso
04-07-2001, 02:26 PM
I did use man cp. It told me that cp -f would force the copy, and without asking me if I really wanted to do it for each file. Or that's the way I INTERPRETED it at least. My command:
cp -f /root/*.* /mnt/msdos/drvf/RH7rpmDefs/
It persists in asking me whether I want to overwrite for each file. How can I make it just transfer these multiple files? I also tried the -u option, but that one wanted to run thru the complete list of files and ask about overwriting also.
The man pages are nice, and not much harder to read than DOS Help (which is no longer included in the newer Windows install, of course). But they lack examples, which were often a life saver in DOS, for me.
Earl
kernel.panic
04-07-2001, 02:37 PM
I think this has to do with the environmental settings (is that the right term) for root. If you did a cp -f as $USER, you would probably not have this problem, but since you are doing it as root, maybe it's over-riding the -f rule.
If you look in /root/.bashrc, you will see this line:
alias cp='cp -i'
Essential, when typing cp -f you are really (because of the alias) typing cp -if. cp -i is the switch that always prompts for overwrite, and it would seem that is the problem, most likely. Try commenting that line out of /root/.bashrc and see if the command works for ya, then. Good luck, captain.
brasso
04-07-2001, 09:38 PM
Thanks. Your suggestion also served to alert me to the fact that I was not displaying hidden files in gnome file manager, hence I couldn't see bashrc. Since I always opted to keep 'hidden' files visible in Windows, I decided to try keeping them all visible in RH7 too. At least for root. And since I never seem to want to do anything (except browse the net) that DOESN'T require root privileges, I go against everyone's best advice and am almost always root. I suppose I'll learn the hard way.
Earl
kernel.panic
04-08-2001, 03:17 AM
Originally posted by brasso:
I go against everyone's best advice and am almost always root. I suppose I'll learn the hard way.
Earl
Yes, Earl, you probably will. I am glad I could help you with your problem, however, I hope I can help by also stressing the same thing everyone else says: Don't run as root. Good advice from those who have learned the hard way...
Anyways, I also recommend you leave the hidden files hidden, because it gets annoying when you ls a dir and get a zillion files. If you ever want to see all the files in a directory, just use ls -a. It's quick, easy, and will spare you from seeing that junk the rest of the time.