Linux centos host name color settings and alias settings, linuxcentos
It's simple and interesting to write today. The reason why the host name color settings and alias settings are written together is that their settings are all in a file .. Bashrc .. Put bashrc in the cd/root directory!
This file stores personal personalized settings, such as command aliases and paths.
1. Linux host name color settings, centos System
Effect:
It's actually very easy!
Run vim. bashrc.
Add this line at the bottom of the file!
Export PS1 = "\ [\ 033] 2; \ H: \ u \ w \ 007 \ 033 [32; 1m \] \ u @ \ 033 [33; 1 m \ H \ 033 [35; 1 m $ ip \ 033 [0 m \ [\ 033 [36; 1 m \] \ w \ [\ 033 [0 m \] \ n \ [\ e [33; 1 m \] # \ [\ e [0 m \]"
Execute the command: source. bashrc
Dear user, try it!
2. linux alias settings
For example, the commonly used command: ps aux | grep to view the process, we are in. in bashrc, add alias psg = "ps aux | grep" to the last line. Then we can view the nginx process and execute the command: psg nginx.
Alias rm = 'rm-I 'alias cp = 'cp-I' alias mv = 'mv-I'
After modification, remember to execute the command: source. bashrc
You can set some commands according to your habits!