Overwrite error caused by alias in linux

Source: Internet
Author: User
Linux alias causes a coverage error-Linux Enterprise Application-Linux server application information. For more information, see the following. Recently, some machines have been upgraded due to previous upgrades that are 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 did not try it. although this problem is solved, it is somewhat depressing!
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.