这个标题真是想不到要写什么!!!
在脚本中或在shell命令行中,一些命令默认自带别名,保存在用户家目录下的~/.bashrc
文件中
# cat ~/.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
额,虽然这里只有三个命令默认自带别名,但是我还真碰到了要使用它!所以记录一下!
符号:\
\
:直接使用命令初始功能,可以理解为不读取~/.bashrc
文件
例如:
1.创建两个文件
# touch file1
# touch file2
2.使用 \ 删除和不适用 \ 的效果!
# \rm file1 # 直接删除
# rm file2 # 不使用 \ 则通过别名执行命令,会提醒
rm: remove regular empty file ‘file2’? n