What Does Your Command Prompt Look Like?
rogain writes: "Show your commandline coolness and post your ubergeek .profile
Donate a clue to the newbie hordes amazed that you can even change the command prompt! A nerdly sort of show-me-yours and I'll-show-you-mine kind of thing." I've attached mine below, but its kinda boring. I'm looking forward to seeing someone come up with a cooler one!
Here's mine:
PS1="$E\033]2;\h:\u:\w\007\033]1;\h\007$R$E$REDBLK$R\u$E$PPLBLK$R@$E$REDBLK$R\h$E$NONE$R\w>"
Because of the lameness filter, I have put my prompt code here That's Date in red, number of messages in my mail spool file in brighter red, current umask in red, current username and active group name in blue, current path in green, hostname in bright green, current command history number, and exit status of the previous command. It's pretty sick. But it provides lots of information.
-- Erich
Slashdot reader since 1997
C:\> C:\spot> C:\spot>run run spot run!
Change someone elses prompt to "". Drives them crazy
until they figure it out.
The difference between Canada and the USA is that in Canada healthcare is a right and gun ownership is a privilege.
Kuro5hin ran an article on shell prompts recently. Rather than retype everything ('cause I'm lazy), I'll just provide a link to my post about my prompt.
--Phil (Still need to add APM stuff to my prompt.)
355/113 -- Not the famous irrational number PI, but an incredible simulation!
ph33r my prompt! Color, upper asci, username, machine and date!!!
\ [\304\[\033[0;34m\[(\[\033[0;36m\[\u@\h\[\033[0;34 m\[)-(\[\0
3 [0;34m\[\304\n\300[\[\033[0;36m\[\w\[
(Actually I kinda ripped the idea off from Mandrake (the Enlightenment guy), but there are some changes).
export PS1="\[\033[11m\[\033[0;34m\[\332\304\[\033[1;34m
33[1;34m\[\`date +\"%a %B %-d %l:%M%P\"\`\[\033[0;34m\[)\[\033[1;34m\[\304\[\03
\033[0;34m\[]:\[\033[0;0m\[ \[\033[10m"
The one point of interest is the 0, which is the termination status of the most recently executed command. This is obtained from bash simply by inserting $? into the PS1 variable.
I got this termination-status-embedding-in-prompt idea from Tanmoy Bhattacharaya.
PS1=$?:\h:\w\$
I have a Mac here, so in my house a command prompt is something that triggers my wife to bark orders at me. :)
grub
yes it's a joke
Trolling is a art,
Set a password on the nobody account and give it a shell... so you can log in.
/bin/sh
passwd nobody
chsh nobody
then telnet into your box:
telnet 127.0.0.1
login as nobody.
Then they can put in all the exits they want and it won't make a diff, especially if you use something like ktelnet or gtelnet.
My journal has hot
Mine looks sorta like this, with some color added:
-[hynfiecl@xenos:~]--- ---[2001/07/06-11:05:42]-$
I have a pretty nasty script that hacks it together. I wrote it after reading the Bash Prompt HOWTO and visiting a Bash themes site that has since been haxx0red. There are more good example prompts, though, at this site. Here's my script, base 64 encoded (sorry, but uuencoding is not conducive to slashposting):
IyEvYmluL2Jhc2gKCmZ1bmN0aW9uIF9wcm9tcHQgewoJbG9jYXSIKCWxvY2FsICAgICBibGFjaz0iXFsbWzA7MzBtXF0iCglsb
OzM0bVxdIgoJbG9jYWwgICAgIGdyZWVuPSJcWxtbMDszMm1cX
XFsbWzA7MzZtXF0iCglsb2NhbCAgICAgICByZWQ9IlxbG1swO
cGxlPSJcWxtbMDszNW1cXSIKCWxvY2FsICAgICBicm93bj0iX
ICAgIGdyZXk9IlxbG1swOzM3bVxdIgoJbG9jYWwgICBka19nc
Y2FsICAgbHRfYmx1ZT0iXFsbWzE7MzRtXF0iCglsb2NhbCAgb
IgoJbG9jYWwgICBsdF9jeWFuPSJcWxtbMTszNm1cXSIKCWxvY
MzFtXF0iCglsb2NhbCBsdF9wdXJwbGU9IlxbG1sxOzM1bVxdI
WxtbMTszM21cXSIKCWxvY2FsICAgICB3aGl0ZT0iXFsbWzE7M
ZXY9IlxbG1s1bVxdIgoKCWxvY2FsIEg9JG5vbmUkYmxhY2sKC
JE0KCWxvY2FsIFQ9JG5vbmUkZ3JleQoJbG9jYWwgUD0kVAoJb
IiRESVNQTEFZIiA9ICc6MC4wJyBdCgl0aGVuCgkJbG9jYWwgR
CWxvY2FsIEI9IsAiCgkJbG9jYWwgTD0itCIKCQlsb2NhbCBSP
Ii0iCgkJbG9jYWwgQT0iICIKCQlsb2NhbCBCPSIgIgoJCWxvY
XSIKCWZpCgoJaWYgWyAtbiAiJEJBU0hfVkVSU0lORk8iIF0K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glyZXR1cm4KfQoKZnVuY3Rpb24gX3Byb21wdF9jbGVhcl9zY
XF0iCglyZXR1cm4KfQoKZnVuY3Rpb24gX3Byb21wdF9jbGVhc
S1xdIgoJcmV0dXJuCn0KCmZ1bmN0aW9uIF9wcm9tcHRfY2hhc
ICAgICAgMCAgIDEgICAyICAgMyAgIDQgICA1ICAgNiAgIDcgI
IGQgICBlICAgZiAKICAweDAwOiAKICAweDEwOiAKICAweDIwO
ICAgJSAgICYgICAnICAgKCAgICkgICAqICAgKyAgICwgICAtI
ICAgMSAgIDIgICAzICAgNCAgIDUgICA2ICAgNyAgIDggICA5I
ICA/IAogIDB4NDA6ICAgQCAgIEEgICBCICAgQyAgIEQgICBFI
ICBLICAgTCAgIE0gICBOICAgTyAKICAweDUwOiAgIFAgICBRI
ICBXICAgWCAgIFkgICBaICAgWyAgIFwgICBdICAgXiAgIF8gC
ICAgYyAgIGQgICBlICAgZiAgIGcgICBoICAgaSAgIGogICBrI
eDcwOiAgIHAgICBxICAgciAgIHMgICB0ICAgdSAgIHYgICB3I
ICB9ICAgfiAgICAKICAweDgwOiAgIIAgICCBICAggiAgIIMgI
MDogICAgICAgiSAgIIogICCLICAgjCAgIAogIDB4YTA6ICAgo
ICAgpiAgIKcgICCoICAgqSAgIKogICCrICAgrCAgIK0gICCuI
ICAgsiAgILMgICC0ICAgtSAgILYgICC3ICAguCAgILkgICC6I
CiAgMHhjMDogICDAICAgwSAgIMIgICDDICAgxCAgIMUgICDGI
ICDMICAgzSAgIM4gICDPIAogIDB4ZDA6ICAg0CAgINEgICDSI
ICDYICAg2SAgINogICDbICAg3CAgIN0gICDeICAg3yAKICAwe
ICDkICAg5SAgIOYgICDnICAg6CAgIOkgICDqICAg6yAgIOwgI
ICDwICAg8SAgIPIgICDzICAg9CAgIPUgICD2ICAg9yAgIPggI
IP4gICD/IApFT0YKCXJldHVybgp9CgpfcHJvbXB0ICRURVJNC
gives new meaning to the term "bottom line" :-)
Check out http://www.shelluser.net/~giles/bashprompt/prompts /index.html for some really extravagent Bash prompts.
7. If your prompt is
;
RYLOMIMNK02 01-07-06 13:08:40
M 0169 COMPLD
;
Chances are good you draw lots of blank stares at parties from packet geeks who don't grok circuit switching. If you've ever replied "SNVS" to someone who bothered you while you were sleeping, or "PICC" to a telemarketer, you need to get out more, but I sympathize.
PS1="C:\\ \w>"
With a little bit of fancy bash work you could probably even get it to change to A:\> when pwd is /mnt/floppy or D:\> when pwd is /mnt/cdrom. If anyone has ideas let me know, I think that it's kind of cute.
________________________
I don't want free as in beer. I just want free beer.
Try this one. Use color !
e [0;36m\](\W)\[\e[0;0m\]$ '
export PS1='\[\e[0;31m\]\u\[\e[1;37m\]@\[\e[0;37m\]\h\[\
[root@6210 /]#
If your command promt looks like:
1. C:\>
You are conservative person. It takes you
some time to accept new techology
2. #
You are respected by colleagues and feared by enemies.
3. joe@cube.some.com:~/joe[12:35 - Fri Jul 6]>
You really like techology, like to learn new things, do not afraid to experiment. You going
to move out of parents place soon.
4. cube:/usr/src/kernel>
With your 20 years if Unix experience you should have no problem finding new job.
5. (Press ^D when you done with fsck)#
Difficult times are ahead of you. Do not lose
your courage and patience.
alias ll='ls -l --color=tty' alias l.='ls .[a-zA-Z]* --color=tty'
alias ls='ls --color=tty'
alias la='ls -al --color=tty'
LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33: so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi =01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=0\
1;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;3 2:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31: *.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=0\
1;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:* .tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.g if=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01\ ;35:*.png=01;35:*.tif=01;35:'
I think the rainbow of color cheers me up.
Putting the IT in Sh**
NORMAL=`tput sgr0 2> /dev/null`
/dev/null`
\ h$ GREY>$NORMAL"
BOLD=`tput bold 2>
RED="\[\033[31m\]"
GREEN="\[\033[32m\]"
BLUE="\[\033[34;1m\]"
GREY="\[\033[1;30m\]"
PURPLE="\[\033[0;35m\]"
PS1="$PURPLE\t$GREY:$BLUE\w\n$RED\u$GREY@$GREEN
PS2="$GREY>$NORMAL ";
-- galihad
They're not keyboard macros, they're aliases. They don't matter outside of the current shell context... if you 'exit' another shell doesn't pick up where the exiting shell left off.
Simple demonstration: try this
bash
alias blah="exit; echo hi; exit"
blah
You should notice that the echo and second exit don't actually ever get executed... it's like putting something straight after a return in a C program.
# (bash syntax, alter appropriately. BTW, not intended for *your* .profile :)
.profile...
export PS1="\nYou are in a room with many doors, all alike\n# "
alias cd="echo That door is locked"
alias pwd="echo You are lost"
alias ls="echo It is too dark to see anything"
alias cat="echo It is too dark to see anything"
alias vi="echo You\\'re not strong enough to perform that action"
alias startx="echo I don\\'t understand"
alias exit="echo You don\\'t know the way out"
# And in case they try to remove their
alias rm="echo I\\'m sorry Dave, I\\'m afraid I can\\'t do that"
For mine I wrote a script that pulls my bank account info, parses it and puts my net worth into an evironment var. Thus, my prompt looks like so:
/]#
[$53,432,566:root@hemorrhage
nifty eh?
Don't think that a small group of dedicated individuals can't change the world. It's the only thing that ever has.
I used to do this to unsuspecting DOS/Windows users:
prompt $p$gformat c:
This yields a prompt of:
c:>format c:
It scares the hell out of newbies.
Portable versions of Firefox, GIMP, LibreOffice, etc
10 input "]"; 20 get A$ 30 print "why would you want to do that?" 40 goto 10 ]save hello
only infrmatn esentil to understandn mst b tranmitd
[root@allevil]$
Yes, my machine is named 'allevil' and I am the root of it.
Lameness filter encountered. Post aborted.
Reason: Junk character post.
Addendum: ...too much, too much! I tried to post the above, and got this as a response:
Easy does it!
This comment has been submitted already, 276231 hours , 34 minutes ago. No need to try again.
I swear that I wasn't on the Internet then. Hell, I wan't even born back then...
Obliteracy: Words with explosions
c:\>
PS1="$PWD> "
to
PS1="
Memory fault(coredump)^G
$PWD>"
(^G being the "beep" character.)
While I was at it, I modified his MSDOS prompt to look similar to his Cygwin prompt, and his Cygwin prompt to:
PS1="$(pwd -P | tr / \\\\)> "
He comes back from vacation on Tuesday. Can't wait...
--
KMSMA (WWBD?)
Some of the prompts posted in these threads will severely harm your system, a couple have already been spotted actually performing 'rm -rf
For the experts here: OK, some people need to find out the hard way
For the newbies: read this:
I've you're really lazy, open a shell, change to root and type 'su nobody', this way, you cannot harm you own system as bad as root or a normal user (although you might lose some unimportant stuff)...
bit me!
For the longest time at home, my prompt was:
It is very dark. If you continue, you are likely to be eaten by a grue.
>