73. Usage of Alias

Source: Internet
Author: User

1. Alias-define or display aliases

1) alias [alias-name = 'ininal-command']

Alias [alias-name [= string]...]

Alias [alias] = [command name]

Use unalias alias-name to cancel an alias.

2) You can use alias to customize the alias of the command. If you only enter alias, all current alias settings can be listed. The role of Alias is limited to the login operation. If you want to automatically set an alias for each login, you can go to/etc/profile or your own ~ /. Set the alias of the command in bashrc.

Use your favorite text editor to create a file called ~ /. Bash_aliases, and type the alias commands into the file .. bash_aliases will run at login (or you can just execute it with .. bash_aliases ). Bash does not try to recursively expand the replacement text.

3) If you want to add the alias LA = 'LS-al' line to the end of/etc/bashrc, bashrc is the configuration file of environment variables,/etc/bashrc and ~ /. The difference between bashrc is that one is set to the entire system, and the other is set to be used by a single user.

Reference

Reference

[1] comprehensive bash command Homepage

Http://ss64.com/bash/alias.html

[2]Http://www.linuxso.com/command/alias.html

[3] a good explanation of Shell

Http://blog.csdn.net/clozxy/article/details/5652275

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.