Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change username in Terminal from .bashrc
#1
I'm going to show you a way to change your username that appears in the terminal before every code that you execute. Mine looks like this:

[Image: Screenshot-1.png]

Where i've replaced "Jason-m40sjd00sd8f ~ $".... with a whole bunch of random numbers and letters.... Into "Infinity ~ $"

Here's how you can do it too.


First open a terminal and type:

Code:
sudo gedit ~/.bashrc

In .bashrc type:

Code:
PS1=" "

Keep this document open for now.

Open another terminal and type:
Code:
echo $PS1

You will end up with an output that looks something like \[\033[01;32m\]\u@\h\[\033[01;34m\] \w $\[\033[00m\]

copy the value that shows up into the .bashrc file and paste it into your .bashrc file in between the quotations in PS1=" ". From there, you'll now want to change the "\u@\h" to whatever you want your username to show up in the terminal.

Example:
Code:
\[\033[01;32m\]Infinity\[\033[01;34m\] \w $\[\033[00m\]

If you followed everything correctly you should have the .bashrc file looking something like this:

Code:
\[\033[01;32m\]Infinity\[\033[01;34m\] \w $\[\033[00m\]

Only instead of Infinity you will have your own username.
Reply
#2
For users without gedit, like myself, this will also work,
Code:
sudo nano /etc/bashrc
Reply
#3
I also took out the annoying fortune game today by editing one of the associated files.

Now upon opening a Terminal all I see is

Code:
Infinity ~ $
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Using Linux Terminal Minus-Zero 5 1,626 06-29-2010, 12:49 PM
Last Post: Canoris
  .Bashrc (Bash) Scorpion 1 789 01-15-2010, 05:26 PM
Last Post: Salmon
  Guake Drop Down Terminal g4143 9 2,113 12-06-2009, 10:24 PM
Last Post: arcofile
  Is there a way to keep terminal ontop of all other windows? nevets04 3 1,460 10-18-2009, 08:06 PM
Last Post: nevets04
  Basic terminal commands and explinations. MyNameIs940 13 4,918 10-08-2009, 04:53 PM
Last Post: Gone

Forum Jump:


Users browsing this thread: 1 Guest(s)