Terminal

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
Boss62
Level 1
Level 1
Posts: 4
Joined: Tue Feb 20, 2018 3:30 pm

Terminal

Post by Boss62 » Thu Mar 08, 2018 10:18 am

Some how I have hidden my username and computer name when I open terminal. Can anyone tell me how to get it to show again?

aes2011
Level 4
Level 4
Posts: 461
Joined: Wed Jul 06, 2011 10:39 pm

Re: Terminal

Post by aes2011 » Thu Mar 08, 2018 10:32 am

Please post the output of grep -i ps1 .bashrc.

User avatar
Flemur
Level 15
Level 15
Posts: 5640
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Terminal

Post by Flemur » Thu Mar 08, 2018 10:33 am

Boss62 wrote:
Thu Mar 08, 2018 10:18 am
Some how I have hidden my username and computer name when I open terminal. Can anyone tell me how to get it to show again?
You mean the bash prompt?
Try this:

Code: Select all

PS1='$USER.\h $ '
(sets prompt = username.hostname $ )

Put a line like the above in your ~/.bashrc file, then it'll be set automagically.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Mint 18.3 Xfce/fluxbox/pulse-less
Xubuntu 17.10/fluxbox/pulse-less

User avatar
Spearmint2
Level 15
Level 15
Posts: 5705
Joined: Sat May 04, 2013 1:41 pm
Location: Maryland, USA

Re: Terminal

Post by Spearmint2 » Thu Mar 08, 2018 10:49 am

Did you change profiles in terminal? Does it show anything?
All things go better with Mint. Mint julep, mint jelly, mint gum, candy mints, pillow mints, peppermint, chocolate mints, spearmint,....

Boss62
Level 1
Level 1
Posts: 4
Joined: Tue Feb 20, 2018 3:30 pm

Re: Terminal

Post by Boss62 » Thu Mar 08, 2018 11:03 am

aes2011 wrote:
Thu Mar 08, 2018 10:32 am
Please post the output of grep -i ps1 .bashrc.

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w \$\[\033[00m\] '
PS1='${debian_chroot:+($debian_chroot)}\u@\h \w \$ '
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h \w\a\]$PS1"

aes2011
Level 4
Level 4
Posts: 461
Joined: Wed Jul 06, 2011 10:39 pm

Re: Terminal

Post by aes2011 » Thu Mar 08, 2018 11:40 am

Open your .bashrc with a plain text editor and add
PS1='\u@\h:\w\$ '
as the very last line. Save the file. Close all open terminal windows. Now, when you open a new terminal window, you should see a prompt that shows, from left to right,
your username
@
your machine name
:
~
$
and a space

The ~ indicates you're in your home folder.

If you move to /etc, ~ will be replaced by /etc and if you go into the skel subfolder it will become /etc/skel.

See help.ubuntu.com/community/CustomizingBashPrompt for more.

Post Reply

Return to “Newbie Questions”