Linux centos host name color settings and alias settings, linuxcentos

Source: Internet
Author: User

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!


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.