LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 03-02-2011, 11:50 AM   #1
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 557

Rep: Reputation: 46
Talking How Does Your Shell Prompt Looks Like?


How Does Your Shell Prompt Look Like? And How Do You Make It?

Reveal the output of this command executed on your Unix / Linux Box:

Code:
echo $PS1
Unimportant Note: How do we edit / modify our subject line / heading on this forum once we have saved it? There is a typo "Looks" in the heading and I do not seem to see a way to edit it.

Last edited by devUnix; 03-02-2011 at 11:54 AM.
 
Old 03-02-2011, 12:00 PM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Well if you must know my shell prompt looks like this:
Quote:
C:\Users\HP_Administrator>
I didn't do anything to create this. It's the system default when I run the terminal as follows:

Start -> Accessories -> Run -> cmd.exe

I think that's the Ubuntu default terminal emulator but I'm not certain.
 
1 members found this post helpful.
Old 03-02-2011, 12:22 PM   #3
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,274
Blog Entries: 1

Rep: Reputation: 1056Reputation: 1056Reputation: 1056Reputation: 1056Reputation: 1056Reputation: 1056Reputation: 1056Reputation: 1056
Code:
(terminal@msdos)-(01:22 PM Wed Mar 02)-(~)
$ >
Unlike stress_junkie, who likes to use the default "Ubuntu" shell prompt , I do mine like this, because I like to know *exactly* what directory I am in, what user I am, and what box I am logged into. This way I won't ever have to say "Oh, sorry, I deleted that file, I thought I was on a development box."

Here is the prompt if you'd like to use it -- its colorized. Blue currently. I've used red and green versions for Dev / Prod, accordingly.

Code:
PS1='\[\033[1;31m\]\[\033[1;30m\](\[\033[1;34m\]\u\[\033[1;37m\]@\[\033[0;37m\]\h\[\033[1;30m\])-(\[\033[0;37m\]\@\[\033[0;32m\] \[\033[1;34m\]\d\[\033[1;30m\])-(\[\033[1;32m\]\w\[\033[1;30m\])\[\033[0;34m\]\n\[\033[1;34m\]\$ \[\033[1;37m\]>\[\033[0;37m\]'

export PS1

Last edited by szboardstretcher; 03-02-2011 at 12:24 PM.
 
1 members found this post helpful.
Old 03-02-2011, 12:55 PM   #4
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 557

Original Poster
Rep: Reputation: 46
Talking

Quote:
Originally Posted by stress_junkie View Post
Well if you must know my shell prompt looks like this:


I didn't do anything to create this. It's the system default when I run the terminal as follows:

Start -> Accessories -> Run -> cmd.exe

I think that's the Ubuntu default terminal emulator but I'm not certain.
Oh! I never knew Ubuntu would imitate DOS stuffs!
 
Old 03-02-2011, 12:59 PM   #5
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 557

Original Poster
Rep: Reputation: 46
Quote:
Originally Posted by szboardstretcher View Post
Unlike stress_junkie, who likes to use the default "Ubuntu" shell prompt
Well, I really appreciate "humour" which you people have shown.
 
Old 03-02-2011, 01:03 PM   #6
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,274
Blog Entries: 1

Rep: Reputation: 1056Reputation: 1056Reputation: 1056Reputation: 1056Reputation: 1056Reputation: 1056Reputation: 1056Reputation: 1056
Quote:
Originally Posted by devUnix View Post
Well, I really appreciate "humour" which you people have shown.
I also included my shell prompt,.. which I think is pretty original. I've been using it for nearly a decade. I actually toyed around with the idea of starting a "shell skinning" website, where I would offer different looking shell prompts with different colors.

never got around to doing that though.
 
Old 03-02-2011, 01:11 PM   #7
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 557

Original Poster
Rep: Reputation: 46
Quote:
Originally Posted by szboardstretcher View Post
I also included my shell prompt,.. which I think is pretty original.
Yes, I have checked it out! Mine looks like this now:

Code:
(root@host-6-33)-(07:49 PM Wed Mar 02)-(~)
# >
Prettier than it looks above.
 
Old 03-02-2011, 01:14 PM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,458
Blog Entries: 54

Rep: Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897
Quote:
Originally Posted by szboardstretcher View Post
I actually toyed around with the idea of starting a "shell skinning" website, where I would offer different looking shell prompts with different colors. never got around to doing that though.
You mean like http://dotfiles.org/.bashrc ?
 
1 members found this post helpful.
Old 03-02-2011, 01:29 PM   #9
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 557

Original Poster
Rep: Reputation: 46
Quote:
Originally Posted by unSpawn View Post
That is great!

I have seen some dotfiles on this website and found them very interesting and useful!

http://dotfiles.org/
 
Old 03-02-2011, 01:38 PM   #10
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,508

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
Mine is something like this (cannot reproduce the exact colors):
Code:
┌─[colucix@linux]-[Working Directory]
└─
 
1 members found this post helpful.
Old 03-02-2011, 01:47 PM   #11
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 557

Original Poster
Rep: Reputation: 46
Quote:
Originally Posted by colucix View Post
Mine is something like this (cannot reproduce the exact colors):
Code:
┌─[colucix@linux]-[Working Directory]
└─
Clever!

I have tried to do that:

Code:
-[root@host-6-33]-[~]
|
-*
You have not shared the output of your:

Code:
echo $PS1
 
Old 03-02-2011, 01:51 PM   #12
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,508

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
He he... it uses Unicode characters! Here is an excerpt from my .bashrc:
Code:
#
#    ┌─   is  u250C + u2500
#    └─   is  u2514 + u2500
#    •    is  u26AB
#    ▪    is  u25AA
#    ▸    is  u25B8
#
G='\033[0;30m' # black
N='\033[0;32m' # green
C='\033[0;36m' # cyan
R='\033[0;31m' # red
W='\033[0m'    # default
export PS1="\[$G\]┌─[\[$N\]\u\[$G\]@\[$C\]linux\[$G\]]-[\[$R\]\W\[$G\]]\n└─• \[$W\]"
 
1 members found this post helpful.
Old 03-02-2011, 02:00 PM   #13
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 557

Original Poster
Rep: Reputation: 46
That is interesting!

But how do we type in this strange symbol in vim?

"\[$G\]┌─[\[$N\]
 
Old 03-02-2011, 02:01 PM   #14
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,274
Blog Entries: 1

Rep: Reputation: 1056Reputation: 1056Reputation: 1056Reputation: 1056Reputation: 1056Reputation: 1056Reputation: 1056Reputation: 1056
Quote:
Originally Posted by colucix View Post
Mine is something like this (cannot reproduce the exact colors):
Code:
┌─[colucix@linux]-[Working Directory]
└─
Very cool. Nice unicodes.
 
Old 03-02-2011, 02:05 PM   #15
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,508

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
Quote:
Originally Posted by devUnix View Post
That is interesting!

But how do we type in this strange symbol in vim?

"\[$G\]┌─[\[$N\]
In vim I don't know. In terminals with support for Unicode you press CTRL-SHFT-U followed by the unicode number + Enter. It works even in the quick reply box here at LQ.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What does your shell prompt look like? david_ross Linux - General 50 04-01-2011 12:15 AM
passing parameters from a unix shell prompt into a windows cmd.exe prompt nano2 Programming 1 09-01-2009 11:26 AM
LXer: Shell tip: Set the shell prompt and themes in Linux Terminal LXer Syndicated Linux News 0 06-12-2007 03:02 AM
Different name at shell prompt XJNick Linux - General 3 08-25-2005 10:20 AM
C shell prompt robson Linux - General 2 11-12-2001 08:08 PM


All times are GMT -5. The time now is 05:01 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration