Use the alias command of ubuntu to simplify complicated and difficult-to-use commands
Source: Internet
Author: User
The alias command of ubuntu is used to simplify many complicated and difficult-to-use commands. now I use ssh to connect to a remote server. each connection has to be like this: sshxiaobing @ testexamplecom or even, sometimes I don't know the domain name, you have to enter an ip address, such as sshxiaobing @ 12223345, and then enter the alias command of password-based ubuntu to simplify many complicated and difficult-to-use commands. now I am using ssh to connect to a remote server. this is required for each connection: ssh xiaobing@test.example.com or even, sometimes do not know the domain name, you have to enter the ip, such as the ssh xiaobing@122.23.34.5 and then enter the password, such command has a few ways to solve: 1, you typed especially awesome, quickly get 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 get it done quickly. Otherwise, it will be hard to find 3. use the up and down keys to make efforts, 4. Use alias to run the commands you want to execute for a long time and use your favorite name. Note: open it 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 replaces 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 quickly, enter [plain] $ source ~ /. Bashrc OK. Now you can enter banana to connect to test.example.com.
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.