Something you can do to keep the CLI entertaining is to customize it to your liking. Sometimes, the default shell style can just be cumbersome to look at. If you want to change the appearance, it’s actually really easy!

No one likes looking at a plain shell. Also, while you can set local shell styling on your terminal client on any PC, those settings only stay on that PC.

You can still get more customization with PS1 definitions and they will follow you from client to client.

Then your shell can look colorful and structure information how you like.

To begin, let me point you to a website:

http://bashrcgenerator.com/

This site will help you generate the colors for your shell and the string that you need to paste.

  • To get started, it’s easiest to click on an example and customize that.

Clicking on one of the elements (such as username) will allow you to modify the properties, like color and bold. You could also re-arrange the elements and add or remove them to your liking.

Here I set a color on almost every element, so the shell should look sort of cartoon-y.

To apply the new style is simple.

SSH or console into your linux machine and edit the ~/.bashrc in nano or vi

nano ~/.bashrc

Scroll all the way down in the file and append the generated output to the end of the file.

Save + quit

To see the changes, either:

  • paste the generated code in your prompt like an usual command

  • logout and login again

  • type “bash” to run a new bash session

Now your shell should be stylized!

For reference this is my generated PS1:

export PS1="\[$(tput bold)\]\[\033[38;5;39m\]\u\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;15m\]@\[$(tput sgr0)\]\[\033[38;5;10m\]\h\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput sgr0)\]\[\033[38;5;6m\][\[$(tput sgr0)\]\[\033[38;5;11m\]\w\[$(tput sgr0)\]\[\033[38;5;226m\]]\[$(tput sgr0)\]\[\033[38;5;160m\]:\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]"

 

I hope this helped you!


0 Comments

Leave a Reply