Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the js_composer domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/holhol2/public_html/wp-includes/functions.php on line 6121
Edit “bashrc” on Linux for Color Prompt – Holhol24 | Linux Tutorials and Guides

Edit “bashrc” on Linux for Color Prompt

4

The bashrc report in Linux is a configuration report containing configurations associated with the gadget’s terminal. This report is performed each time you log into your Linux gadget. By making other adjustments to this report, you’ll simply customise your Linux terminal inside seconds. This comprises converting the colour of the suggested, taking part in round with the fonts, converting the consumer names that seem at the terminal, and many others. For this actual dialogue, we’re taken with learning the process of enhancing the bashrc report for converting the colour of the suggested in a Ubuntu 20.04 gadget.

Method of Editing “bashrc” for Changing the Color of the Prompt in Ubuntu 20.04:

Along with providing more than one different terminal customization choices, the bashrc report in Linux will also be edited to switch the suggested’s colour. For studying the process of doing so, you’ll have to cross throughout the next steps. However, we want to point out previously that on this manner, we can first train you the way to create a backup of the default settings so that you could all the time repair them each time you wish to have. After that, we can percentage with you the process of fixing the colour of the suggested, and for that, we have now shared rather a couple of examples so that you could see how the suggested will appear to be after converting its colours. Finally, we have now taught you the process of restoring the default suggested colour in Ubuntu 20.04. So now, allow us to get began with the next steps:

Step # 1: View the “bashrc” File in your Ubuntu 20.04 System:

The bashrc report can simply be considered on a Ubuntu 20.04 gadget by means of the usage of any textual content editor of your selection. Here, we’re going to use the nano editor for this objective, and we can open the bashrc report with the assistance of the command proven beneath:

The bashrc report of our Ubuntu 20.04 gadget is proven within the following symbol:

In this report, the phase by which the attributes of the variable PS1 are outlined is essential for us. Basically, this variable permits you to customise your terminal in different alternative ways, in conjunction with converting the colour of the suggested, which we can be told later on this article.

Step # 2: Take a Backup of the Relevant Variable of this File:

Now, for converting the colour of the suggested in Ubuntu 20.04, we can be making some adjustments to the PS1 variable. However, prior to doing so, it’s extremely beneficial that you’re taking a backup of that variable in order that if you happen to reduce to rubble with anything else all the way through this entire procedure or even supposing you simply need to return to the default suggested colour, you are going to simply have the ability to do this. For that, we can be copying the price of the PS1 variable to some other variable. You can assign any title of your option to this variable. The command proven beneath will serve this objective:

This command will merely assign the default worth of the PS1 variable to the TEMP variable, from the place it may be restored later. This command is not going to generate any output upon a hit execution.

Step # 3: Change the Color of your Ubuntu 20.04 Prompt from Green to Red:

Now, when we have now taken a backup of our PS1 variable, we will simply exchange it to switch the colour of our Ubuntu 20.04 suggested. The default colour of our Ubuntu 20.04 suggested is inexperienced. In this step, we can merely try to exchange this colour to crimson. For that, we can execute the below-appended command:

$ PS1=“[33[31m]u@h:w$”

Running this command within the Ubuntu 20.04 terminal can even replicate those adjustments on your bashrc report.

As quickly as you hit the Enter key for operating the command as discussed above, you are going to realize the colour of your gadget’s suggested converting from inexperienced to crimson, as proven within the symbol beneath:

Step # 4: Change the Color of your Ubuntu 20.04 Prompt from Red to Blue:

You have observed how you’ll exchange the colour of your Ubuntu 20.04 gadget’s suggested from inexperienced to crimson. Now, you are going to see how you’ll exchange it from crimson to blue. For that, you’ll have to run the affixed command on your terminal:

$ PS1=“[33[34m]u@h:w$”

Running this command within the Ubuntu 20.04 terminal can even replicate those adjustments on your bashrc report.

As quickly as you hit the Enter key for operating the command as discussed above, you are going to realize the colour of your gadget’s suggested converting from crimson to blue, as proven within the symbol beneath:

Step # 5: Change the Color of your Ubuntu 20.04 Prompt from Blue to White:

By now, you could possibly have realized the way to exchange the colour of your Ubuntu 20.04 gadget’s suggested from inexperienced to crimson and crimson to blue. Now, you are going to see how you’ll exchange it from blue to white. For that, you’ll have to run the below-cited command on your terminal:

$ PS1=“[33[37m]u@h:w$”

Running this command within the Ubuntu 20.04 terminal can even replicate those adjustments on your bashrc report.

As quickly as you hit the Enter key for operating the command as discussed above, you are going to realize the colour of your gadget’s suggested converting from blue to white, as proven within the symbol beneath:

Step # 6: Restore the Original Color of your Ubuntu 20.04 Prompt:

In the similar approach, you’ll exchange the colour of your suggested by means of the usage of different other colour codes too. So now, we can train you the way to repair the unique colour of your Ubuntu 20.04 suggested. You bear in mind we stored the default worth of the PS1 variable of our bashrc report to a variable named TEMP originally of this technique. The sole objective of doing so was once to create a backup of the default worth of the PS1 variable in order that it may be restored later. For doing that, you merely want to execute the below-appended command within the terminal:

Running this command within the Ubuntu 20.04 terminal can even replicate those adjustments on your bashrc report.

As quickly as you hit the Enter key for operating the command as discussed above, you are going to realize the colour of your gadget’s suggested converting from white to its default colour, i.e., inexperienced, as proven within the symbol beneath:

Conclusion:

This article defined to you intimately how you’ll simply exchange the colour of your Ubuntu 20.04 gadget’s suggested just by making some minor adjustments on your bashrc report. By following the exact same manner, you’ll additionally experiment with other colours. However, the one factor you want to watch out about is prior to continuing with converting the colour of your suggested, and also you should take a backup of the related variable of your bashrc report. This is finished to make sure that you don’t lose any essential configurations, and you’ll all the time return to the default configurations each time you’re feeling love it.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More