直接輸入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,保存退出即可