Alias command for Linux systems: using aliases

Source: Internet
Author: User
Tags aliases

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/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.