Detailed explanation of alias commands in CentOS

Source: Internet
Author: User
Alias command function description: some of the commands that we often use but are very long at system management. Then we can create an alias for these long strings of commands. This long string of commands can be directly replaced by an alias. The system already has some default command aliases. It can be viewed in alias. You can also view ~ /. Bash_profile. this is the alias of the user. To define a global alias, you can write the definition to the/etc/bashrc file. Use the Alias command

Function description:We must have some commands that we often use but are very long at system management. Then we can create an alias for these long strings of commands. This long string of commands can be directly replaced by an alias. The system already has some default command aliases. It can be viewed in alias. You can also view ~ /. Bash_profile. this is the alias of the user. To define a global alias, you can write the definition to the/etc/bashrc file. Aliases that are passed through alias are automatically cleared after the system is restarted. After the modification, it takes only a moment for the source to take effect.

Syntax:Alias [alias] = [command name]

Cancel alias: Unalias [alias]


Instance used:

(1) default system alias

[Root @ LiWenTong test4] # alias

Alias cp = 'CP-I'

Alias l. = 'ls-d. * -- color = tty'

Alias ll = 'ls-l -- color = tty'

Alias ls = 'ls -- color = tty'

Alias mv = 'MV-I'

Alias rm = 'rm-I'

Alias which = 'Alias |/usr/bin/which -- tty-only -- read-alias -- show-dot -- show-til

Note: When defining an alias, there cannot be spaces on both sides of the equal sign.

------------------------------- Subsequent self-summary ------------------------------------------

[PS: To be honest, this really cannot be understood again. it's just the equation generation in junior high school. Alias stands for aliases in English. It is just to give long things an alias for easy use. In addition, the system also has some aliases. for example, the command alias is the command itself + parameter.]


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.