LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 11:51 AM   #1
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
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, 12:56 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

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

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

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
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, 01: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, 02:30 PM   #5
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
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, 03: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 11:51 AM.
 
1 members found this post helpful.
Old 08-28-2012, 05: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: 2
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, 05: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, 09:31 AM   #9
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Original Poster
Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
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, 09: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 10:15 AM.
 
Old 08-29-2012, 02:35 PM   #11
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Code:
DOS='C:${PWD//\//\\\}>'
PS1="\[\033[00m\]\[\033[00m\]\[\033[01;39m\]$DOS\[\033[00m\]"
because #oldguysrule
 
1 members found this post helpful.
  


Reply



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 03:30 PM
[SOLVED] Color prompts screws bash ! MotherDawg Fedora 5 08-08-2010 02:56 PM
LXer: Colors and Prompts in Bash LXer Syndicated Linux News 0 03-11-2007 09:16 AM
BASH: How to answer command prompts using redirects ?? swedish_lunacy Linux - Newbie 1 07-25-2006 02:28 AM
Newbie questions:Bash Prompts newinlinux Linux - Newbie 9 03-10-2004 06:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:19 AM.

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
Open Source Consulting | Domain Registration