Linux | Modify command line color matching

Sure enough, as you get older, you still need to archive a lot of things.

Otherwise, I would just rely on my little brain.

Maybe I burped early

For example, today I want to change the color of the command line of the new account.

Then~

Then my mind went crazy

I just can't remember that line of command

Then I went to the previous account and copied and pasted it hahahahaha

I'd better record it!

Hello! I'm good! Hello everyone!

Generally our default interface looks like this:
initial state

Unremarkable·Simple and generous·Charming and charming

Although I have always pursued simplicity

But

Actually sometimes

Hanafutame Autumn

It's not that it's unlovable

Like this
ideal state

How about we do it all together?

first! Enter your server!
Get in!
We can see that there is a .bashrcfile, which is the next focus of attention!

  1. Enter the command vim .bashrcto open the file;
    open a file

  2. Enter ito enter edit mode (you can see the lower left corner changes to INSERT);edit mode

  3. Copy the following command and write it into .bashrcthe file, press Escto exit the editing mode and return to the normal mode;

    export PS1="\[\033]2;\h:\u \w\007\033[33;1m\]\u \033[35;1m\t\033[0m \[\033[36;1m\]\w\[\033[0m\]\n\[\e[32;1m\]$ \[\e[0m\]"
    

    write file

  4. Enter :wqEnter to save and exit;
    Save and exit

  5. Next we enter source ~/.bashrcreload and the settings will take effect! Bingo!
    final state

Nice!!!

Guess you like

Origin blog.csdn.net/weixin_43843918/article/details/125729770