Use the Mac terminal to set shortcut commands with Alias

Source: Internet
Author: User

Entering shortcut commands in the terminal can improve productivity while keeping a few commands in mind

How to do:

First edit in the ~/directory. Bash_profile This hidden file, if you want to directly double-click this file to open the editor, please enter it in the terminal

Mac Show hidden files command defaults write Com.apple.finder appleshowallfiles-bool true

At this point you find the. bash_profile file in the ~/directory and open this file

After opening make sure that your source is set up, if not. BASHRC, add one under the ~/.bash_profile file, You can edit a file named. BASHRC through the terminal or with a text editor (this file will load the source from the file into bash when Bash is launched)

Then add the following command in the ~/.BASHRC

Of course, if you don't want to edit this every time. BASHRC hidden files, you can again specify a source path in your. bashrc file to refer to the external visible file as in. BASHRC Add the following red box content

Then you can use alias to add an alias command to your. BASHRC or external source file, and then restart the terminal for the aliases command in the terminal.

command example:

Then when the terminal enters Open_safari, it will

Automatically opens Safari.

Use the Mac terminal to set shortcut commands with Alias

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.