首先编辑~/.bash_profile文件,如果不存在就直接新建一个。
vi ~/.bash_profile
然后在文件里添加需要的别名,格式如:
alias [别名]=‘[实际命令]’
alias l='ls -lh'
alias vbp='vi ~/.bash_profile'
编辑结束后,用以下命令使bash_profile在当前命令行环境生效:
source ~/.bash_profile
首先编辑~/.bash_profile文件,如果不存在就直接新建一个。
vi ~/.bash_profile
然后在文件里添加需要的别名,格式如:
alias [别名]=‘[实际命令]’
alias l='ls -lh'
alias vbp='vi ~/.bash_profile'
编辑结束后,用以下命令使bash_profile在当前命令行环境生效:
source ~/.bash_profile