Use the alias command of ubuntu to simplify complicated and difficult-to-use commands

Source: Internet
Author: User

Using ubuntu's alias command to simplify many complex and difficult-to-use commands now I am using ssh to connect to a remote server, each connection has to be like this: ssh xiaobing@test.example.com or even, sometimes do not know the domain name, you have to enter the ip, such as ssh xiaobing@122.23.34.5 and then enter the password, this command has a few ways to solve: 1, you typed a particularly awesome, very soon done, this is good 2, use ctrl + r to enter the first few letters and search for the commands you have previously entered. If you are lucky, you will be able to do it quickly. Otherwise, it will be hard to find 3. You will find 4 by turning up and down the key, use alias to write down the commands you want to execute for a long time in your favorite name. The method is to open them in your favorite editor. bashrc file, At the end enter: [plain] alias banana = 'ssh xiaobing@test.example.com 'alias apple = 'ssh xiaobing@122.23.34.5' Note: The above command is to replace banana with the one enclosed in quotation marks, that is, enter banana, just like executing the ssh xiaobing@test.example.com in shell, but don't rush to use it, there is another, you have to make this configuration file take effect immediately. Enter [plain] $ source ~ /. Bashrc OK. Now you can enter banana to connect to test.example.com.

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.