linux命令 - alias

时间:2024-07-29 20:04:20

linux命令 - alias

为自己的常用命令语句指定别名,快捷方式

$ alias /?
Usage:
alias [/reload] [/d] [name=full command]
/reload Reload the aliases file
/d Delete an alias (must be followed by the alias name) If alias is called with any parameters, it will display the list of existing aliases.
In the command, you can use the following notations:
$* allows the alias to assume all the parameters of the supplied command.
$1-$9 Allows you to seperate parameter by number, much like %1 in batch.
$T is the command seperator, allowing you to string several commands together into one alias.
For more information, read DOSKEY/?

如何给个多个命令组合指定别名

如果不管命令执行是否成功都往下执行,可以用;分割多个语句放在一行执行,如果希望前面的执行成功才执行后面的语句,用&&分割语句。

#任何位置都直接切换到github
alias github = D: && cd d:\github

...