Aliases alias, File Move overlay

Source: Internet
Author: User

[Email protected] ~]# Touch/tmp/test.txt

[Email protected] ~]# Touch/mnt/test.txt

[Email protected] ~]# cp/mnt/test.txt/tmp/

Cp:overwrite '/tmp/test.txt '?



[Email protected] mnt]#/bin/cp/mnt/test.txt/tmp/

[Email protected] mnt]# \cp/mnt/test.txt/tmp/



[[email protected] mnt]# alias

Alias cp= ' Cp-i '

Alias l.= ' ls-d. *--color=auto '

Alias ll= ' Ls-l--color=auto '

Alias ls= ' ls--color=auto '

Alias mv= ' Mv-i '

Alias rm= ' Rm-i '

So using the CP command is the cp+ confirmation message.

The/BIN/CP or \CP is the alias of the shielded system, which does not return a confirmation message when using CP.

To cancel an alias:

[Email protected] mnt]# Unalias CP

[[email protected] mnt]# alias

Alias l.= ' ls-d. *--color=auto '

Alias ll= ' Ls-l--color=auto '

Alias ls= ' ls--color=auto '

Alias mv= ' Mv-i '

Alias rm= ' Rm-i '

Alias Which= ' Alias | /usr/bin/which--tty-only--read-alias--show-dot--show-tilde '

Define aliases:

[[email protected] mnt]# alias cp= ' Cp-i '

[[email protected] mnt]# alias

Alias cp= ' Cp-i '

Alias l.= ' ls-d. *--color=auto '

Alias ll= ' Ls-l--color=auto '

Alias ls= ' ls--color=auto '

Alias mv= ' Mv-i '

Alias rm= ' Rm-i '

Alias Which= ' Alias | /usr/bin/which--tty-only--read-alias--show-dot--show-tilde '



[email protected] ~]# alias wuyike= "Echo I am wuyike."

[email protected] ~]# alias |grep wuyike

Alias Wuyike= ' Echo I am wuyike. '

[Email protected] ~]# Wuyike

I am Wuyike.

You must use echo or you will get an error. Function: Use simple to represent complex

[[email protected] ~]# alias rm= "Echo RM can not is used,please use MV"

[Email protected] ~]# RM wuyike.txt

RM can not is used,please use MV Wuyike.txt


View current aliases: (Change the alias for root user by changing this file)

[[email protected] ~]# grep ALIAS/ROOT/.BASHRC

# User specific aliases and functions

Alias rm= ' Rm-i '

Alias cp= ' Cp-i '

Alias mv= ' Mv-i '

All users are in effect: defined in/ETC/BASHRC or/etc/profile

Entry into force: Source/etc/profiles




Aliases alias, File Move overlay

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.