Linux CentOS Host name color settings and alias settings

Source: Internet
Author: User

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

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.