This is my current prompt below:
To change the prompt you will update .bashrc and set the PS1 environment variable to a new value.
Here is a cheatsheet of the prompt options:
You can use these placeholders for customization:
I want to change my prompt to say
Here is my new prompt I am going to use:
Can you guess what that does? Yes for my article writing this is exactly what i want. Here is the screenshot:
A lot of people will want the Username, Hostname, for my example i don’t! But you can use u and h for that. I used w to show what directory i am in. You can also show date and time, etc.
You can also play with setting colors in the prompt with these variables:
Background Colors:
e[40m – Black
e[41m – Red
e[42m – Green
e[43m – Yellow
e[44m – Blue
e[45m – Magenta
e[46m – Cyan
e[47m – White
Reset Color:
e[0m – Reset to default
Here is my colorful version. The backslashes are primarily needed to ensure proper formatting of the prompt and avoid breaking its functionality.
This uses Magenta, Blue and Red coloring for different parts of the prompt.
You can see how to customize your bash prompt with PS1 environment in Ubuntu. Hope this helps you be happy with your environment in linux.
Kolla Ansible provides production-ready containers (here, Docker) and deployment tools for operating OpenStack clouds. This…
This public beta enables the full Ubuntu Desktop experience on the Qualcomm Dragonwing™ QCS6490 and…
Time is running out to be in full compliance with the EU Cyber Resilience Act,…
Identity management is vitally important in cybersecurity. Every time someone tries to access your networks,…
Welcome to the Ubuntu Weekly Newsletter, Issue 889 for the week of April 20 –…
Introduction I just returned from RubyKaigi 2025, which ran from April 16th to 18th at…