How to force cp to overwrite without confirmation
You can do yes | cp -rf xxx yyy
, but my gutfeeling says that if you do it as root - your .bashrc
or .profile
has an alias of cp
to cp -i
, most modern systems (primarily RH-derivatives) do that to root profiles.
You can check existing aliases by running alias
at the command prompt, or which cp
to check aliases only for cp
.
If you do have an alias defined, running unalias cp
will abolish that for the current session, otherwise you can just remove it from your shell profile.
You can temporarily bypass an alias and use the non-aliased version of a command by prefixing it with \
, e.g. \cp whatever
Copying directories to a server and deleting all unnecessary files
rsync --delete
is the trick.
Thanks to Gordon Davisson and his comment.
Related Topics
Linux Custom Executable Globally Available
Where Is Path Variable Set in Ubuntu
How to Find the Processor/Chip Architecture on Linux
How to Get Curl to Not Show the Progress Bar
How to Recover After Deleting the Symbolic Link Libc.So.6
Shell-Init: Error Retrieving Current Directory: Getcwd -- the Usual Fixes Do Not Wor
How to Link to Shared Lib from Shared Lib with Relative Path
Explanation of Convertor of Cidr to Netmask in Linux Shell Netmask2Cdir and Cdir2Netmask
Logrotate to Clean Up Date Stamped Files
Get First Line of a Shell Command's Output
Equivalent of Ctrl C in Command to Cancel a Program
Difference Between Gnuwin32 and Cygwin
Genymotion Throws Libssl_Conf.So: Cannot Open Shared Object File: No Such File or Directory
How to Determine Ssl Cert Expiration Date from a Pem Encoded Certificate