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/