Re: cp command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 18 Jul 2006, Kaushal Shriyan wrote:

> Hi ALL
> 
> if i will run following command
> 
> cp /home/deep /home/deepak
> 
> if deep folder have same 100 files which is under /home/deepak it will
> ask permission for overwrite
> 
> i have to enter y 100 times. how can i forcefully over write the files?

You must be running as 'root'. The problem is that FC has a default alias 
for root set on cp that maps it to 'cp -i' (which causes it to ask you for 
permission before overwritting a file). Before you start, type 'unalias 
cp':

[root@localhost /]# unalias cp
[root@localhost /]# cp /home/deep /home/deepak

But that is still probably not doing what you think it is doing and will 
generate a "cp: omitting directory '/home/deep'" error because you have 
not specified the '-a' flag to recursively copy in archive mode.

Better would be to use rsync to recursively copy one tree to the other in 
archive mode:

[root@localhost /]# rsync -a /home/deep/ /home/deepak/

-- 
Benjamin Franz

"It is moronic to predict without first establishing an error rate
 for a prediction and keeping track of one’s past record of accuracy."
                    -- Nassim Nicholas Taleb, Fooled By Randomness
-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux