直接输入
vi ~/.bashrc
然后在文本的最后加上你要起alias的命令,例如
# .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
alias cls='clear'
最后一行就是要启用的alias,保存退出即可
# .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
alias cls='clear'
最后一行就是要启用的alias,保存退出即可