Set command alias using alias in Ubuntu

Source: Internet
Author: User
Use alias in Ubuntu to set command alias purpose: alias is used to create a simple name format for a long command or path: alias New Command & amp; rsquo; original Command & amp; rsquo; note: the original command must be enclosed in single quotes. Note that there cannot be spaces on both sides of the equal sign. if the path is set... in Ubuntu, alias is used to set command alias usage: alias is used to create a simple name format for a long command or path: alias new command = 'original command 'note: the original command must be enclosed in single quotes. Note that there cannot be spaces on both sides of the equal sign. if the path is set to a directory, note that a new unalias command must be included at the end. if you want to cancel the command, you can use the new unalias command to cancel the command. this command can only be used during the current logon (the current terminal can use it, re-open the new terminal is not available), and disappears after restart. If you need to use it for a long time, you can write it to the. bashrc file in the user directory. if you want to set it to take effect immediately, use the source Command for example: vim ~ /. Bashrc alias gj = 'sudo shutdown-h now 'save and exit ---> This command means immediate shutdown. source ~ /. Bashrc or .~ /. If bashrc gj has a password, enter your password. if there is no password, it will immediately shut down. you can define the command as follows: source is equivalent to. command. It means to execute the built-in bash command ~
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.