Write something simple and interesting today. As for why the host name color settings and alias settings are written together because their settings are in a file. . BASHRC. The . BASHRC is placed under the cd/root directory!
This file mainly preserves some personal personalization settings, such as command aliases, paths, and so on.
1. linux hostname color setting, CentOS system
As the effect:
In fact, very simple Oh!
Execute command:vim. BASHRC
Adding this line at the bottom of the file is OK!
Export ps1= "\[\033]2;\h:\u \w\007\033[32;1m\]\[email protected]\033[33;1m\h \033[35;1m$ip\033[0m \[\033[36;1m\]\w\[ \033[0m\] \n\[\e[33;1m\]# \[\e[0m\] "
Make the changes effective execute the command:source. BASHRC
Pro: can try Oh!
2. Alias settings for Linux
For example, commonly used commands: PS aux | grep looks at the process, and we add alias psg= "ps aux | grep" in the last line of the . BASHRC and then we look at the Nginx process and execute the command:PSG nginx is OK.
Alias rm= ' rm-i ' Alias cp= ' cp-i ' Alias mv= ' Mv-i '
After modification, remember to execute the command:source. BASHRC
Wait for some commands you can set according to your own habits!
Linux CentOS Host name color settings and alias settings