Linux command alias-alias

Source: Internet
Author: User
Alias is a shortcut that saves the trouble of inputting a long string of commands. It can also unify differences between Windows, Linux, and Unix commands to meet users' input habits. $

Alias is a shortcut that saves the trouble of inputting a long string of commands. It can also unify differences between Windows, Linux, and Unix commands to meet users' input habits.

$ Alias new_command = 'command sequence'

$ Alias ll = 'ls-Al'

# The configured alias is temporary. once the terminal is closed, the configured alias becomes invalid. to keep the alias valid, you can add it ~ /. Bashrc file. (Every time a new SHELL is generated, it will execute ~ /. The command in bashrc) is as follows:

$ Echo 'Alias cmd = "command seq" '> ~ /. Bashrc

To delete an alias, you only need to extract the corresponding statement from ~ /. Bashrc, or use the unalias command.

Note: When creating an alias, if an alias with the same name already exists, the original alias settings will be replaced.

Sometimes, Aliases may cause security problems: in an untrusted environment, commands may have been disguised and important information such as accounts and passwords may be stolen.

Methods to avoid such problems:Escape aliases (add \ before the command \)

$ \ Command

# Escape commands so that we can execute the original commands instead of the commands themselves.

Related Article

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.