LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 11-17-2003, 12:20 AM   #16
pibby
Member
 
Registered: Oct 2003
Location: Houston, TX
Distribution: Debian Sid
Posts: 100

Rep: Reputation: 15

Thanks for the help, I didnt realize that I could type anything in there, thought it had to be something like /h or /w. Thanks again
 
Old 11-17-2003, 02:19 AM   #17
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
i use the default as well, but i have experimented with a few
C:$PWD>
for instance (not much of a fooler because of the slashes instead of backslashes but still kinda funny)
 
Old 11-17-2003, 06:24 AM   #18
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
You're an evil person, frieza. It took me awhile to figure out and it's definitely not thoroughly tested, but it seems to work - I had a hard time going about it the wrong way. I set it pretty easily but couldn't get it to persist through 'cd' commands until I completely rethought it.

Try this Fake Working Directory in your ~/.bashrc or wherever. Very funny. *g*
Code:
PS1="C:\$(fwd)>"

function fwd () {
echo $PWD | sed 's/\//\\/g' | tr [:lower:] [:upper:]
}
 
Old 11-17-2003, 06:55 AM   #19
a slacker
Member
 
Registered: Aug 2003
Distribution: Arch
Posts: 44

Rep: Reputation: 15
bash-2.05b$
 
Old 11-18-2003, 01:52 PM   #20
DarkSpy
LQ Newbie
 
Registered: Sep 2003
Distribution: Slackware
Posts: 19

Rep: Reputation: 0
Code:
(19:51)[darkspy@Orion darkspy]$ cd Downloads/
(19:51)[darkspy@Orion Downloads]$ echo $PS1
($(date +%H:%M))[\u@\h \W]$
(19:51)[darkspy@Orion Downloads]$
 
Old 11-28-2003, 03:52 AM   #21
Sammy2ooo
Member
 
Registered: Jan 2003
Location: nearby switzerland
Distribution: Suse 8.0 / Suse 9.0 / Slackware 9.1 / Debian Sarge testing / Gentoo 1.4.10
Posts: 165

Rep: Reputation: 30
this is what my bash prompt looks like:

echo $PS1

Code:
\[\033[0m\]\[\033[1;33m\]\j\[\033[0m\]\[\033[1;30m\]\t\[\033[0m\]\[\033[31m\]\u\[\033[0m\]@\[\033[1;34m\]\033[37m\]\w$\[\033[0m\]
 
Old 11-28-2003, 06:25 AM   #22
TheOneKEA
Member
 
Registered: Oct 2003
Distribution: Debian GNU/Linux 11 (amd64) w/kernel 6.0.15
Posts: 299

Rep: Reputation: 30
export PS1="[\u@\h \W]$ "
for normal users

export PS1="[\u@\h \W]# "
for root

[theonekea@Ganymede theonekea]$

But I may change it, after seeing the stuff in this thread.
 
Old 11-29-2003, 12:29 AM   #23
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 48
mine's also pretty basic:
PS1='\[\e[36;1m\]\u@\h:\[\e[34;1m\]\w \$\[\e[0m\]'
PS2=~>

i wanted to add the current directory to the title bar instead, to save space, but it messes things up when in console mode.

Last edited by synaptical; 11-29-2003 at 12:33 AM.
 
Old 11-29-2003, 07:52 AM   #24
fatgod
Member
 
Registered: Mar 2002
Location: Edinburgh, Scotland
Distribution: Suse 7.2, Gentoo 1.4, Solaris 9
Posts: 661

Rep: Reputation: 30
< /usr/local/games >
[ Sat Nov 29 ¤ 13:34:11 --- fatgod @ odin ]
$ echo $PS1
\n\033[1;33m\] < \w >\n\033[1;32m\][ \d \244 \t --- \u @ \H ]\n \033[1;37m\]$


Which is virtually impossible to see on a light background... but works well enough on darkened tranparent windows. And when I 'su' the username turns red.
 
Old 11-29-2003, 07:59 AM   #25
dkaplowitz
Member
 
Registered: Oct 2002
Location: Havertown PA
Distribution: Ubuntu/RHEL/Fedora
Posts: 253

Rep: Reputation: 31
$
 
Old 10-17-2004, 04:05 PM   #26
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
I make it easy on myself, at the top I define the colors I use.........
Code:
 # Color Variables for Prompt
GRAD1='\333\262\261\260'
GRAD2='\260\261\262\333'
YLOBRN='\[\033[01;33;43m\]'
WHTBRN='\[\033[01;37;43m\]'
REDBRN='\[\033[01;31;43m\]'
BLUBRN='\[\033[01;34;43m\]'
GRNBRN='\[\033[00;32;43m\]'
REDBLK='\[\033[00;31;40m\]'
PPLBLK='\[\033[01;35;40m\]'
WHTBLK='\[\033[01;37;40m\]'
NONE='\[\033[00m\]'
HBLK='\[\033[00;30;30m\]'
HBLU='\[\033[01;34;34m\]'

BLU='\[\033[01;34m\]'
YEL='\[\033[01;33m\]'
WHT='\[\033[01;37m\]'
PRPL='\[\033[00;35m\]'
RED='\[\033[01;31m\]'
GRN='\[\033[01;32m\]'          
GRAY='\[\033[01;30m\]'
PINK='\[\033[01;35m\]'
NORM='\[\033[01;00;0m\]'
CYAN='\[\033[01;36m\]'


export GRAD1 GRAD2 YLOBRN WHTBRN REDBRN BLUBRN GRNBRN 
REDBLK PPLBLK WHTBLK NONE HBLK HBLU BLU YEL WHT PRPL 
RED GRN GRAY PINK NORM CYAN
my user prompt is this:
Code:
PS1="$GRN\h  $RED\w $YEL\$  $NONE$NORM"
Hence:
Chessmaster ~ $

When I'm root: Chessmaster is Red and the working directory is Green

Last edited by 320mb; 10-17-2004 at 04:06 PM.
 
Old 10-17-2004, 04:35 PM   #27
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 48
I have a fairly bland command prompt. The only thing that I really like to have is a \n at the front, which puts a blank line between the last output and the new prompt
 
Old 10-17-2004, 05:47 PM   #28
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
Glad you guys resurrected this thread. I searched for it a couple of
months ago but could not find it no matter what string I entered...
 
Old 10-17-2004, 06:34 PM   #29
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
Quote:
Originally posted by Chinaman
Glad you guys resurrected this thread. I searched for it a couple of
months ago but could not find it no matter what string I entered...
I found it by accident.........I was searching for some info on /etc/profile.d
and came upon it...............hopefully it won't go dead again for awhile...........
 
Old 10-17-2004, 07:11 PM   #30
SocialEngineer
Member
 
Registered: May 2003
Distribution: Slackware
Posts: 236

Rep: Reputation: 31
[19:11:21][will@hexbox1lnx]$

PS1="[\t][\u@\h\\$ "
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Different name at shell prompt XJNick Linux - General 3 08-25-2005 10:20 AM
change the shell prompt ust Linux - Distributions 5 04-28-2005 03:26 PM
Shell Prompt xneowolf Linux - General 5 01-26-2003 02:06 AM
Shell prompt setup NSKL Linux - Newbie 1 06-15-2002 11:55 AM
C shell prompt robson Linux - General 2 11-12-2001 08:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:36 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