[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