An alias is a shortcut that eliminates the hassle of users entering a long list of commands, and can unify windows, Linux, and Unix command differences to meet user input habits.
$ alias new_command= ' command sequence '
$ alias ll= ' Ls-al '
#此时设置的别名是暂时性的, once the terminal is closed, the alias set is invalidated and can be placed in the ~/.BASHRC file in order for the alias to remain valid. (Every time a new shell is generated, the commands in ~/.BASHRC are executed) as follows:
$ Echo ' Alias cmd= ' command seq ' >> ~/.BASHRC
If you want to remove the alias, simply delete the statement that corresponds to it, or use the Unalias command.
Note: When an alias is created, the original alias setting is replaced if an alias with the same name already exists.
Sometimes, aliases can also create security issues: In the context of mistrust, commands may have been disguised, may be stolen accounts, passwords and other important information.
Ways to avoid such problems: escaping aliases (before the command plus \)
$ \command
#字符 \ Escapes the command so that we can execute the original command rather than the command itself.
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/