Modify “username@hostname” part in the Bash prompt
Most of the Linux distributions contain the username@hostname as a bash prompt. We can change it to anything we want. We have to just modify the value of the PS1 variable. In the above two sections, we have seen how to modify the value of the PS1 characters permanently and temporarily. Change the value of PS1 according to your need. So now to change the username@hostname to “myprompt@linux> ” we can set the value of PS1 to
export PS1="myprompt@linux> "
Now let’s see how to add emojis in the bash prompt. To add the emojis to the prompt, first, make sure that you have installed any emoji font on the system. To use the emoji in the prompt, just put the emoji in the PS1 variable. Here is one example:
PS1="???? ~ "
To show the version of bash shell in the prompt, put the \v prompting character in the PS1 variable:
PS1="Bash \v>"
And to show the current bash version with the patch level, use the \V prompting character:
PS1="Bash \V>"
How to Customize Bash Colors and Content in Linux Terminal Prompt
If you are using the Linux operating system, that means you use the CLI most of the time. And do more work on the terminal. By default, most Linux Operating systems provide you the bash shell. Shell provides the interface between the user and kernel and executes commands. In this article, we are going to see how to customize the bash shell prompt