1.介紹
alias命令用于設(shè)置指令的別名,unalias指令用于取消命令別名
可以將一些冗長但常用的命令設(shè)置成別名,通過輸入簡短的別名達(dá)到同樣的效果
2.語法
alias [-p] [name[=value] ... ]
unalias [-a][別名]
3.參數(shù)
1 alias 2 alias l='ls -l' 3 alias rm='rm -i' 4 ... 5 alias vi='vim'
1 alias l 2 alias l='ls -l'
1 pwd 2 /home/wzl 3 alias cdlog='cd /home/wzl/log/`date +%Y%m%d`/BUP' 4 cdlog 5 pwd 6 /home/wzl/log/20200707/BUP
1 cd log/bap 2 vi 20200707.log(輸入11122345,保存) 3 cd - 4 alias logMsg='cd log;cd bap;vi 20200707.log' 5 logMsg 6 11122345(顯示)
1 unalias logMsg 2 logMsg 3 -bash: logMsg: command not found
1 vi .bashrc 2 logM='cd log/bap;vi 20200707.log' (插入 .bashrc) 3 logM 4 -bash: logMsg: command not found 5 source .bashrc 6 logM 7 11122345 |
|