Site icon JILAXZONE

Linux Tip: Here’s how to hide Computer name and Username in Terminal Command Prompt

linux ubuntu application drawer jilaxzone.com

Ubuntu Application Drawer

TL;DR

Each time you open Terminal, by default you would see your username and your computer name appear on the Terminal screen. While showing the username and computer name are good so that you know exactly which computer you are logging into and which username you are using to log into the computer, but if you plan to make something like tutorial where you will share your Terminal screen to the whole world, having both your computer and user ID on the Terminal screen are not really a good idea. Now, let me show you the simple way if you want to get rid of the username and computer name from the Terminal screen.

Linux Terminal Showing Username and Computer name

Here’s how you can hide your Computer Name and Username in Terminal Window

Tested on following Linux distro, so if you are using different distros / version, your steps may be slightly different. But fret not, in case you have any questions, I’ll try my best to answer and assist.

OS: Ubuntu 22.04.1 LTS (Jammy Jellyfish)
Kernel: Linux 5.15.0-46-generic.

Follow these simple steps to hide your computer name and username in Terminal screen.


Step 1) Open bashrc

Type in the following command and press Enter:

nano  ~/.bashrc 

This will open bashrc file in edit mode.


Step 2) Alter the PS1 variable

Scroll to the bottom of .bashrc file, then at the very bottom, press Enter to create a new line then add:

export PS1=”\W \$”

Linux Bashrc – adding export PS1 statement to remove username and computer name from Terminal screen

Step 3) Save bashrc

Using nano editor, press Ctrl+X then press “Y” to save the file.

When asked for saving into which file name confirmation, press Enter to save to the same bashrc file.


Step 4) Restart Terminal

Simply close your current Terminal window and reopen a new Terminal window.


Linux Terminal is no longer showing username and computer name

You should now see the Terminal screen will no longer showing your username and computer name on it.


Bring it all together

Another day another Linux tips, this time is about removing your username and computer name from the Terminal screen. The steps are pretty simple and easy to be done, so if you plan to share some screenshot to anyone else, ensure you have done the steps mentioned above. In case you have queries or are facing difficulties, don’t hesitate to put your issues or thoughts down below on the comment section. I’ll be happy to assist!

Want more Linux tips and tricks? Do check them out here: Linux tips and tricks at JILAXZONE. Image courtesy of Microsoft.

Interested to see other Windows tips and tricks? Check them out here: Linux tips and tricks at JILAXZONE.


Do you have anything you want me to cover on my next article? Write them down on the comment section down below.

Alternatively, find more interesting topics on JILAXZONE:

FREE!LifeTech
How-ToPositive Cash FlowAndroid
TravelAll articlesiOS & iPhone

JILAXZONE – Jon’s Interesting Life & Amazing eXperience ZONE.


Hi, thanks for reading my curated article. Since you are here and if you find this article is good and helping you in anyway, help me to spread the words by sharing this article to your family, friends, acquaintances so the benefits do not just stop at you, they will also get the same goodness and benefit from it.

Or if you wish, you can also buy me a coffee:

Thank you!

Live to Share. Share to Live. This blog is my life-long term project, for me to share my experiences and knowledge to the world which hopefully can be fruitful to those who read them and in the end hoping to become my life-long (passive) income.

My apologies. If you see ads appearing on this site and getting annoyed or disturb by them. As much as I want to share everything for free, unfortunately the domain and hosting used to host all these articles are not free. That’s the reason I need the ads running to offset the cost. While I won’t force you to see the ads, but it will be great and helpful if you are willing to turn off the ad-blocker while seeing this site.