Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux terminal interface font color settings     - CentOS / RedHat system partition essential requirements and partition scheme (Linux)

- Into the Java keyword instanceof (Programming)

- rsync server set up (Server)

- Why do I prefer Git (Linux)

- CentOS installation Percona Server 5.5.42 compiling problem solve one case (Linux)

- Windows7 system using Vagrant to build Linux virtualized development environment (Linux)

- Java generate two-dimensional code by Zxing (Programming)

- Let 32 Linux / CentOS system to support more than 4G memory (Linux)

- Android Scroller call mechanism and the relationship of computeScroll (Programming)

- How to extend / remove swap partitions (Linux)

- Linux password file security issues detailed usage (Linux)

- About Hibernate cache, you want the latest data have trouble even session.clear (Database)

- Oracle Linux 6.4 (BOND) dual NIC teaming combat - Annotated (Linux)

- Linux boot process and run level (Linux)

- CentOS 6.6 install JDK7 (Linux)

- MySQL development common query summary (Database)

- Linux System Getting Started Tutorial: How do you know Shell which is currently being used (Linux)

- Analysis examples: Intrusion Response Linux platform Case (Linux)

- Linux pwd command learning experience (Linux)

- Ceph tuning --Journal and tcmalloc (Server)

 
         
  Linux terminal interface font color settings
     
  Add Date : 2018-11-21      
         
         
         
  Table of Contents

Explanation
PS1
Color Syntax
Save Settings

Explanation
The Internet to find a lot of information is not very detailed, and it was a syntax error.
So we get a long time to understand the whole, easy to write down the people behind the study.
I Linux virtual machine version is CentOS 6.5 and nuances of other possible versions of Kazakhstan.

PS1
PS1 is an environment variable Linux end users, for explaining the command line prompt settings. In the terminal enter the command: echo $ PS1, PS1 will define the output:

PS1 = '[\ u @ \ h \ W] $'

linux default command line prompt is: [first name last item of the current working directory of the user account name @ host] $
PS1 defined in commonly used parameters have the following meanings:

\ D: # represents the date in the format weekday month date, for example: "Mon Aug 1"
\ H: # full host name
\ H: # take only the first name of the host
\ T: # display for 24-hour format, such as: HH: MM: SS
\ T: # display for 12-hour format
\ A: # show time is 24 hour format: HH: MM
\ U: # Name of the user's current account
\ V: #BASH version information
\ W: # complete working directory name
\ W: # use basename get working directory name, it lists only the last directory
\ #: # Issued the first of several commands
\ $: # Prompt character, if you are root, the prompt is: #, compared with the average user: $

Color Syntax
Wherein a color format: in \ [\ e [F; Bm], to \ e [m End

F B Color
3040 Black
3141 Red
3242 Green
3343 yellow
3444 blue
3545 purple
3646 cyan
3747 White
For example, we should \ u change color

PS1 = "[\ [\ e [31; 40m] \ u \ e [m @ \ h \ W] \ $"

And we will \ u foreground color set to red, the background color is black.

PS1 = "[\ u \ [\ e [31; 40m] @ \ e [m \ [\ e [36; 40m] \ h \ e [m \ [\ e [31; 40m] \ W \ e [m ] \ $ "

Modify the @ sign red color is the foreground color to background color is black, \ h as the foreground color to cyan background color is black, \ W is the foreground color to red background color is black.

Save Settings
We will set a good PS1 variable written .bashrc inside, so behind the open terminals are valid.

$ Cd ~
$ Vi .bashrc
Add a line open

PS1 = "[\ u \ [\ e [31; 40m] @ \ e [m \ [\ e [36; 40m] \ h \ e [m \ [\ e [31; 40m] \ W \ e [m ] \ $ "

Save and exit it.
     
         
         
         
  More:      
 
- AngularJS - Getting Started with Routing (Programming)
- How to troubleshoot Windows and Ubuntu dual system time is not synchronized (Linux)
- Hadoop 2.5 Pseudo distribution installation (Server)
- Delete specific files using bash directory under Linux (Linux)
- 10 Codes of good practice PHP (Programming)
- Linux 64-bit porting (Programming)
- Making Linux root file system problems on-link library (Programming)
- Java string intern constant pool resolution Introduction (Programming)
- Ubuntu Linux use MAC binding against ARP attacks (Linux)
- Share Java-based multithreading file case (Programming)
- Linux process group, session daemon (Linux)
- Linux Task Scheduler (at, crontab) (Linux)
- How to install Ubuntu California - the calendar application (Linux)
- Cacti monitoring service Nginx (Linux)
- Linux text processing tool of sed (Linux)
- Get and Post requests Comments (Linux)
- Oracle Data Pump Example (Database)
- independently configurable PHP environment under CentOS6.5 (Server)
- CentOS 6.4 Python 2.6 upgrade to 2.7 (Linux)
- How do you temporarily emptied Bash environment variable before running the command on Linux (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.