Found this usefull, expecially when creating shell scripts to copy massive directories to backups... the force parameter does not actually work with the standard CentOS set up. Remember to logout and log back in to get this to work.
From Red Hat Magazine - Justin Payne
From Red Hat Magazine - Justin Payne
How can I change the behavior of the copy (cp) command when it asks if I want to overwrite the existing file, even though I passed it the "-f" argument?
by Justin Payne
Symptom:
The command cp -f <filename> </path/to/some_existing_file> ask to overwrite the existing file, even though the -f argument was passed.
The command cp -f <filename> </path/to/some_existing_file> ask to overwrite the existing file, even though the -f argument was passed.
Solution:
To change this behavior, edit the /root/.bashrc file and comments out (or remove) the alias line that adds the -i argument to the cp command:
To change this behavior, edit the /root/.bashrc file and comments out (or remove) the alias line that adds the -i argument to the cp command:
# alias cp='cp -i'
The changes should take affect when a new user session is started or the/root/.bashrc file has been sourced in the current session.
Comments
Post a Comment