You might be in scenarios where you might want to hide your username or computer name or current working directory in your Ubuntu. I will walk you through a step-by-step easy procedure to do achieve that.
Open bashrc by using the below command. There are multiple ways to open bashrc, you can use any text editor like vim, nano etc. But here we are using a gedit a GUI based text editor which may not be a favourite text editor for everyone, but it does the job well and easily.
gedit ~/.bashrc
Once the bashrc is opened in the gedit window,scroll down to the end of the bashrc file like the below screenshot.
At the end of the file, add a new line by clicking the Enter button and type the below statement.
export PS1="\W \$"
After adding the text type Ctrl+S (Save the file) and close the text editor.
Then run the below command
source ~/.bashrc
Which will refresh the bashrc file to reflect the new changes. Is kind of important setup without this your new changes won’t be reflected.
Once done, close your terminal and open a new terminal, which should look like the below the screenshot.
© 2022, Datalieve . All rights reserved.
Leave a Reply