Set terminal to color in Mac OS X.

Source: Internet
Author: User

The reason why we like OS X so much is that it comes with the command line tool, but Apple has set a lot of default values for terminal, which makes the interface ugly and we are very sad that there is no color, at the same time, we want the interface to be colorful, at least in color. Enter "ls" in terminal, for example:

I have found several ways to adjust the color on the network. Although it can be used, most of them need to install some theme, which is too troublesome,

After I checked the help of "man ls", I found a super simple solution without installing any theme.

The procedure is as follows:

1) Open the terminal. The color scheme is as follows:

2) enter the following command: VI ~ /. Bash_profile and paste the following to this document for saving.

# Tell ls to be colourfulexport CLICOLOR=1export LSCOLORS=Exfxcxdxbxegedabagacad # Tell grep to highlight matchesexport GREP_OPTIONS=‘--color=auto‘

Enter source ~ /. Bash_profile Initialization Configuration for the current window to take effect

You should see that the color already exists, as shown below:

  • Clicolor = 1 // color your terminal.
  • Lscolors =... // Specify the specific project for coloring.

3) add more colors to get more color reminders, keep the previously added rows, and append them to the backend.

export TERM="xterm-color"PS1=‘\[\e[0;33m\]\u\[\e[0m\]@\[\e[0;32m\]\h\[\e[0m\]:\[\e[0;34m\]\w\[\e[0m\]\$ ‘

After setting, you can see that the username and command line have colors:

All the above steps are available for the test.

 

All the above information is translated. If any, please correct me.

Link: http://crunchify.com/how-to-change-mac-os-x-terminal-color/

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.