Copy Force Flag Not Working on CentOS 8 for Sudo or Root User

Mindwatering Incorporated

Author: Tripp W Black

Created: 02/14/2021 at 01:31 AM

 

Category:
Linux
Other

Issue:
Attempting to copy files from one location to another with:

$ sudo cp -raf /folder/folder2/ /folder3/folder2/

The prompt to confirm each file for overwrite occurs.


Solution:
Check if there is an alias for the cp command for the current user. If there is temporarily override it for the current session.
$ sudo alias

To workaround:
$ sudo su
<pwd>
# unalias cp
# cp -raf /folder/folder2/ /folder3/folder2/




previous page