
And, just for the sake of restoring the settings back, you should keep a backup of the PS1 environment variable (copy-paste what’s in it by default) to a text file. Unless you’re sure what you’re doing, do not change anything. You can access the file by simply typing: nano ~/.bashrc bashrc file (this is a configuration file that loads up every time you load up a session). So, to make this a permanent change, you need to add it to. If you close the session, you will lose the customization. The above command that I mentioned temporarily customizes the bash prompt for the current session. So, just keep in mind the codes for customization and play around with it till you’re sure you want this as a permanent change. This is how your bash prompt will look like after typing the command:Īs you can notice, the color customization is the same no matter the order. You just need to type in the following to change the color and font: PS1="\e\h:\w\a\$]" Color range for background colors: 40-47.Codes for text format: 0 for normal text, 1 for bold, 3 for italic and 4 for underline text.The output in your case can be different, but the variables will be the same, so you need to play with the commands mentioned below depending on your output. \u indicates the username followed by the symbol.\e is a special character that denotes the start of a color sequence.We need to focus on the first part of the output: \0 \ \h: \w\a\]$ You can learn more about it in the man page.įor instance, when you type in: echo $PS1 You will need to utilize the PS1 environment variable which controls what is being displayed as the prompt. However, you can tweak the font and color of the bash prompt ( :~$) using commands. Tip 5: NOT RECOMMENDED: Changing the font and color of the bash prompt (for advanced users) Similarly, you can also change your username, but it requires some additional configuration that includes killing all the current processes associated with the active username, so we’ll avoid it to change the look/feel of the terminal. To permanently change the hostname, you need to type in: sudo hostnamectl set-hostname CUSTOM_NAME So, when you restart, it will revert to the default. However, this will be applicable only for the current sessions. To change the hostname, you can type in: hostname CUSTOM_NAME
