[Shell&mac&environment variables] own commonly used Mac (or Linux) Shell command summary, including MAC using ZSH Shell environment variable configuration method

Source: Internet
Author: User

Today when I use Tomcat configuration, I use a Mac that uses some commands to configure Tomcat.

Here's the problem:

I am particularly troublesome to start the Tomcat service every time, because I have to go to the file directory where Tomcat is located, or not to use ~/, but because I put Tomcat in a more "deep" folder, the command looks ugly and long.

Problem Solutions:

1. Use environment variables (methods for modifying. BASHRC)

A. First look at what shell your Mac is currently using

Echo $SHELL

The returned results are similar to

Here I am zsh, maybe you are bash, but that's OK, the pattern of configuring environment variables is the same

B. Then you need to know what files zsh or bash will execute each time you open the terminal (Google searches, there is a lot of information),

Here you just need to know the files that will be executed, zsh words are. ZSHRC Bash's words are. BASHRC

So you need to open. ZSHRC (if it's bash, open. BASHRC), use VI vim cat Open with your

And then, at the end, type

Export path=/users/zazalu/music/: $PATH

The middle path fills in the path you want to add to the system environment variable.

Save when you're done modifying

C. Then activate the configuration you just

source. ZSHRC   // The word for bash is source. BASHRC

D. Restart the terminal and you will find that the environment variable is already configured ~

2. Rename a terminal instruction using alias

can see this Oh ~

http://blog.unieagle.net/2012/05/21/

[Shell&mac&environment variables] own commonly used Mac (or Linux) Shell command summary, including MAC using ZSH Shell environment variable configuration method

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.