LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-28-2012, 12:51 PM   #1
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,774
Blog Entries: 1

Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
Anyone use any cool Bash Prompts?


What is your unique PS1= ?

I have a pretty good one, but I'm wondering if anyone has something interesting.
 
Old 08-28-2012, 01:56 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,577
Blog Entries: 14

Rep: Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969
A nice trick for your coworkers is to set their:
PS1=login:

 
1 members found this post helpful.
Old 08-28-2012, 02:04 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,921

Rep: Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690
Quote:
Originally Posted by szboardstretcher View Post
What is your unique PS1= ?

I have a pretty good one, but I'm wondering if anyone has something interesting.
Try these in your .bashrc :
Code:
PS1="\[\033[1;36m\][\u@\[\033[1;37m\]\h:\[\033[1;33m\]\w]\\$\[\033[0m\] "
SUDO_PS1="\[\033[1;31m\][\u@\[\033[1;37m\]\h:\[\033[1;33m\]\w]\\$\[\033[0m\] "
I like it, since a 'normal' user will be cyan, with the current working directory and prompt in yellow, when you have a SUDO shell, the user turns red.
 
2 members found this post helpful.
Old 08-28-2012, 02:12 PM   #4
cortman
Member
 
Registered: Jan 2012
Location: ZZ9 Plural Z Alpha
Distribution: Crunchbang 11, LFS 7.3, DSL 4.1.10, Lubuntu 12.10, Debian 7
Posts: 219

Rep: Reputation: 43
Quote:
Originally Posted by MensaWater View Post
A nice trick for your coworkers is to set their:
PS1=login:

LOL. That's a good one.

I have my zsh prompt and terminal environment customized... image here.
 
1 members found this post helpful.
Old 08-28-2012, 03:30 PM   #5
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,577
Blog Entries: 14

Rep: Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969
Quote:
Originally Posted by szboardstretcher View Post
Running: RHEL 6 on a VIC 20
Funny that.

Some years ago I posted a thread as a joke saying I was trying to get Linux installed on my Adam computer and noted it had the "full" 56 k RAM upgrade.
 
1 members found this post helpful.
Old 08-28-2012, 04:57 PM   #6
Renante
LQ Newbie
 
Registered: Aug 2012
Location: Ottawa ON, Canada
Distribution: Red Hat Enterprise Linux 6.3 Server
Posts: 13

Rep: Reputation: 2
Quote:
Originally Posted by szboardstretcher View Post
What is your unique PS1= ?

I have a pretty good one, but I'm wondering if anyone has something interesting.
@ .bashrc
export export PS1="\[\033[0m\][\[\033[1;32m\]\u@\[\033[1;37m\]\h \[\033[1;33m\]\W\[\033[0m\]]\\$\[\033[1;32m\] "

Preview

Last edited by Renante; 08-29-2012 at 12:51 PM.
 
1 members found this post helpful.
Old 08-28-2012, 06:17 PM   #7
leosubhadeep
Member
 
Registered: Jul 2012
Location: West Bengal,India
Distribution: Ubuntu 14.04,Fedora 20,Windows 7
Posts: 111
Blog Entries: 3

Rep: Reputation: 1
Quote:
Originally Posted by Renante View Post
@ .bashrc
export PS1="\[\033[0m\]\[\033[0m\][\[\033[1;32m\]\u@\[\033[1;37m\]\h \[\033[1;33m\]\W\[\033[0m\]]\[\033[1:32m\]\\$ "
Your prompt is awesome. I'm trying to make a tri-color rectangle based on your color scheme.
Can you tell me a site that explains different formatting options for bash or any other shell?
 
Old 08-28-2012, 06:33 PM   #8
Renante
LQ Newbie
 
Registered: Aug 2012
Location: Ottawa ON, Canada
Distribution: Red Hat Enterprise Linux 6.3 Server
Posts: 13

Rep: Reputation: 2
Quote:
Originally Posted by leosubhadeep View Post
Your prompt is awesome. I'm trying to make a tri-color rectangle based on your color scheme.
Can you tell me a site that explains different formatting options for bash or any other shell?
Try this link: http://www.thegeekstuff.com/2008/09/...ngelina-jolie/
 
Old 08-29-2012, 10:31 AM   #9
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,774
Blog Entries: 1

Original Poster
Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
Me and my brother were really into BBS's and ANSI and stuff back in the day. So, its no surprise that he took his prompts/dir colors to the next level. Here is the code for it.

Code:
CLr0="\[\033[0;30m\]"
CLr1="\[\033[0;34m\]"
CLr2="\[\033[0;32m\]"
CLr3="\[\033[0;36m\]"
CLr4="\[\033[0;31m\]"
CLr5="\[\033[0;35m\]"
CLr6="\[\033[0;33m\]"
CLr7="\[\033[0;37m\]"
CLr8="\[\033[1;30m\]"
CLr9="\[\033[1;34m\]"
CLr10="\[\033[1;32m\]"
CLr11="\[\033[1;36m\]"
CLr12="\[\033[1;31m\]"
CLr13="\[\033[1;35m\]"
CLr14="\[\033[1;33m\]"
CLr15="\[\033[1;37m\]"
PS1="$CLr4($CLr8\u$CLr15@$CLr7\h$CLr4)-($CLr7\@$CLr2 $CLr8\d$CLr4)-($CLr12\w$CLr4)$CLr1\n$CLr8\\$ $CLr15>$CLr7"
export PS1
 
Old 08-29-2012, 10:55 AM   #10
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Rep: Reputation: Disabled
Is zsh OK?

Regular user:

Code:
PS1=$'

┌──[ \e[0;32m%n @ %M\e[0m ]─[ %d ]
└╼ $ '
Looks like: http://www.hostpic.org/images/46scr_1346251624.png

Root:

Code:
PS1=$'

┌──[ \e[0;31m%n @ %M\e[0m ]─[ %d ]
└╼ # '
Looks like: http://www.hostpic.org/images/19scr_1346251650.png

Last edited by Mr. Alex; 08-29-2012 at 11:15 AM.
 
Old 08-29-2012, 03:35 PM   #11
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,159
Blog Entries: 10

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
Code:
DOS='C:${PWD//\//\\\}>'
PS1="\[\033[00m\]\[\033[00m\]\[\033[01;39m\]$DOS\[\033[00m\]"
because #oldguysrule
 
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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Colorized Bash Prompts carlosinfl Arch 12 10-04-2010 04:30 PM
[SOLVED] Color prompts screws bash ! MotherDawg Fedora 5 08-08-2010 03:56 PM
LXer: Colors and Prompts in Bash LXer Syndicated Linux News 0 03-11-2007 10:16 AM
BASH: How to answer command prompts using redirects ?? swedish_lunacy Linux - Newbie 1 07-25-2006 03:28 AM
Newbie questions:Bash Prompts newinlinux Linux - Newbie 9 03-10-2004 07:15 PM


All times are GMT -5. The time now is 10:08 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration