alias 别名
在.bash_profile 增加以下别名lss='pwd' 命令
alias lss=‘pwd'
保存后。
source .bash_profile
shell> lss
/Users/kevin
比如开发运维人员在办公网络经常访问机房服务器。有时会采用通过跳板机的方式链接如果每次都需要输入:ssh yourname@192.168.1.1 太麻烦了。
所以我们可以通过设置别名的方式执行。
alias tbj='ssh yourname@192.168.1.1'
保存后执行
source .bash_profile
完成。
以后就可以通过:shell> tbj
输入密码