Article Title: instance resolution: overwrite error caused by Alias in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Versions of some machines are upgraded, because the previous upgrade is used to using mv im for backup. bak then releases another im package. At present, this upgrade is faced with overwriting of some files, but there are also many, with hundreds of files, when cp-Rf/home/im/usr/local is used, is there a large amount of coverage?
So man cp
-F, -- force
If an existing destination file cannot be opened, remove it and try again
I didn't seem to mention overwriting and don't notice. I thought I was using the wrong command. So Baidu and google went down and found that-f didn't prompt me. I wondered, at the tip of my colleague, I said that there was an alias problem. So I ran the following alias:
Alias cp = 'cp-I'
Alias l. = 'LS-d. * -- color = tty'
Alias ll = 'LS-l -- color = tty'
Alias ls = 'ls -- color = tty'
Alias mv = 'mv-I'
Alias rm = 'rm-I'
Alias which = 'Alias |/usr/bin/which -- tty-only -- read-alias -- show-dot -- show-tilde'
The problem is that, as my colleague said, it is because this problem is not prompted when rm-rf is used, but man rm
-F, -- force
Ignore nonexistent files, never prompt
He does not mean anything;
No, you cannot find a solution. Try it first.
Edit root user/root
And global alias. If you want to change the alias used by a user, you can find the alias in the/home directory and execute vi. bashrc
#. Bashrc
# User specific aliases and functions
Alias rm = 'rm-I'
Alias cp = 'cp-I'
Alias mv = 'mv-I'
# Source global definitions
If [-f/etc/bashrc]; then
. /Etc/bashrc
Fi
~
~
Comment out alias cp = 'cp-I'
Run the saved. Bashrc File
Source ~ /. Bashrc
Run cp-Rf/home/im/usr/local. In fact, you don't need-f at this time, but I didn't try it. The machine should use it, then I will not try it. Although this problem is solved, it is somewhat depressing!