Reasons for using \cp command under linux

Sometimes you see that you are used to using \cp -rf instead of cp -rf when copying files. There is a difference between the two: when the first one is used, the system will not prompt whether to overwrite, and when the second one is used, the system will prompt. So why is this? Also set the -f attribute. I haven't studied it seriously before, I only know how to use it. After checking some information, I understand:

The default cp command in Linux is aliased, that is to say, when the cp command is executed, the aliased command is actually executed.

Use the alias command to view the alias settings of the current system:

You can see that the cp command has set an alias. This will not take effect even with cp -f.

\cp will call the native cp command without aliasing, so it works.

In addition to \cp, there is another way to write:

#unalias cp

#cp -rf ***

First unalias, then call. The unalias command is not permanent.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325720852&siteId=291194637