What Does Your Command Prompt Look Like? 568
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>"
you nerds (Score:2)
Re:Root prompt (Score:2)
Re:prompt (Score:2)
set prompt='All your argv[]s are belong to us: '
Mine: Lots of info, lots of colors. Link to code (Score:3)
Color is good. (Score:2)
Also, there's the bashish theme engine thingy that some people should look at. I've seen some really amazing prompts (well, sort of -- they don't always work).
In my
[ -f
if [ "$EUID" = "0" ]; then
PS1="$BRIGHT$BLUE[$RED\u$WHITE@\h$BLUE][$YELLOW
else
PS1="$BRIGHT$BLUE[$CYAN\u$WHITE@\h$BLUE][$YELLO
fi
[ -f
In my
if [ "$1" = "unset" ];
then
{
#
# unset all:
#
unset BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE
unset BGBLACK BGRED BGGREEN BGYELLOW BGBLUE BGMAGENTA BGCYAN BGWHITE
unset BRIGHT NORMAL REVERSE BLINK UNDERSCORE
}
else
{
#
# foreground colors:
#
BLACK='\[\033[30m\]'
RED='\[\033[31m\]'
GREEN='\[\033[32m\]'
YELLOW='\[\033[33m\]'
BLUE='\[\033[34m\]'
MAGENTA='\[\033[35m\]'
CYAN='\[\033[36m\]'
WHITE='\[\033[37m\]'
#
# background colors:
#
BGBLACK='\[\033[40m\]'
BGRED='\[\033[41m\]'
BGGREEN='\[\033[42m\]'
BGYELLOW='\[\033[43m\]'
BGBLUE='\[\033[44m\]'
BGMAGENTA='\[\033[45m\]'
BGCYAN='\[\033[46m\]'
BGWHITE='\[\033[47m\]'
#
# attributes:
#
BRIGHT='\[\033[01m\]'
NORMAL='\[\033[00m\]'
REVERSE='\[\033[07m\]'
BLINK='\[\033[05m\]' # doesn't work in xterms
UNDERSCORE='\[\033[04m\]' # only works in xterms
# zzzzzz='\[\033[00m\]' # last env var
}
fi
--
VGA lines without vga font (Score:2)
To go into and out of this mode, use these:
LINE='\[\016\]'
UNLINE='\[\017\]'
The letters `jklmnqtuvwx' correspond to different line characters when in this mode (well, single-line chars, at least).
--
Re:Color is good. (Score:2)
There should only be a single space in the prompt, between '\\$' and '$NORMAL'
--
I like mine chock full of goodness! (Score:2)
%(!.%B#%b.)<%m/%l> %(?.%{%}.%B%?%b )(%h %B%(4c,.../%3c,%~)%b)%B:%b
An average prompt looks like:
<escaflowne/p7> (128 ~):
A more interesting one:
#<escaflowne/p7> 5 (2
Down that path lies madness. On the other hand, the road to hell is paved with melting snowballs.
Re:I like mine chock full of goodness! (Score:2)
(int the
HOSTTYPE=`uname`
prompt="%(!.%B#%b.)<%m/$HOSTTYPE/%l> %(?.%{%}.%B%?%b )(%h %B%(4c,.../%3c,%~)%b)% B:%b "
I did this because I was constantly forgetting what type of machine I was on, especially with the dual booters and the machines that changed OS all the time. Unfortunatly it make the prompt string a little longer than I normally like, but at least I didn't run killall on the Suns.
Down that path lies madness. On the other hand, the road to hell is paved with melting snowballs.
Re:prompt (Score:2)
setenv HOSTNAME `hostname | sed 's/\..*//' | tr \[a-z] \[A-Z]`
set prompt = "C:\\"{$HOSTNAME}"> "
(I switch between machines a lot, so it makes sense to use the hostname rather than the directory name.) However, it gets worse... I once knew a former mainframe guru whose UNIX prompt was configured to look like VM/CMS.
Re:this is just absurd (Score:2)
And you must admit it's a hell of a lot better than the kid trying to get started by cracking sites and turning into a script kiddie.
My prompt (yes this is really old) (Score:3)
Re:I good trick to play (Score:2)
-Paul Komarek
Re:KSH Prompt? (Score:2)
PS1='$PWD$ '
(Note the single quotes)
-Dom
CVS for your init files - and a project idea (Score:2)
The non-.local files are managed by CVS; my CVS repository is out there on the 'net on my private server, so from any 'net-connected *nix system with CVS, I can just CVS checkout my init files. Also whenever I change something on one system I can check it in and then update it on the other systems when I get to them.
I even had the idea once of making this a sort of public service - setting up some simple scripts and programs as glue for managing the CVS side of things, and then putting a public CVS server up on the 'net just to allow people to check in their init files. Then someone could easily use this service to keep all of their init files up-to-date and consistent on every system they use.
Actually, I am slowly working on some new OS ideas and one of my ideas is exactly this - a public (secure) repository for user configuration info so that whenever a user of the OS goes anywhere, their preferences can easily follow them.
If anyone else wants to take this idea and run with it, be my guest.
I good trick to play (Score:5)
until they figure it out.
Just the basics (Score:2)
---
ticks = jiffies;
while (ticks == jiffies);
ticks = jiffies;
Something like this (Score:2)
---
ticks = jiffies;
while (ticks == jiffies);
ticks = jiffies;
My bash prompt. (Score:2)
case $USER in
root)
PS1="(\# \u \h \w)\n>> "
;;
*)
PS1="(\# \u \h \w)\n> "
;;
esac
export PS1
This means that my prompt looks like this if I'm a user:
(1 jeh myhost
>
and as root
(1 root myhost
>>
So I can tell at a glance exactly who and where I am, and still have nearly a full screen width for commandline editing.
Re:See my post on The Other Site (Score:2)
Ok, since this post actually elicited email response (which the Kuro5hin one didn't), I've put up a description of my prompt at http://www.geeksimplex.org/phil/prompt/ [geeksimplex.org]. Enjoy.
--Phil (Yep, I'm replying to one of my own posts.)
See my post on The Other Site (Score:3)
Kuro5hin [kuro5hin.org] ran an article on shell prompts [kuro5hin.org] recently. Rather than retype everything ('cause I'm lazy), I'll just provide a link to my post about my prompt [kuro5hin.org].
--Phil (Still need to add APM stuff to my prompt.)
'leet color prompt (Score:4)
(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"
Simple: 0:hostname:~$ (Score:3)
I got this termination-status-embedding-in-prompt idea from Tanmoy Bhattacharaya.
PS1=$?:\h:\w\$
Bashprompt. (Score:2)
da w00t.
My prompt (Score:2)
yes, master? ~
Re:I good trick to play (Score:2)
This only works with the rm in GNU fileutils. Traditional Unix rm mostly used
Even that didn't work on all versions of Unix. The only way to be sure was to provide a path to the file:Re:I good trick to play (Score:3)
You can normally only do this if you have root access, or if they're careless enough to leave themselves logged on. If it's the latter, a favourite trick at University used to be to create a file called "*" in their home directory. The number of people that just did rm * to get rid of it is quite astonishing...
Whatever title to pass antilameness: Another (Score:2)
You are conservative person. It takes you
some time to accept new techology
0. A>
How did you managed to get the generator running all these year in this island? By the way, the Soviet Union disappeared.
I received:
This comment has been submitted already, 276325 hours , 47 minutes ago. No need to try again.
__
zsh prompt & xterm codes (Score:2)
export PS1='%B%m%(?..[%?])%(#.#.)%b '
export PS2='%B%_%(#.#.)%b '
export RPS1='%B%~:%*%b'
Explanation:
PS1 is the left-side prompt for normal commands, PS2 is for inside things like for & while loops. RPS1 is the right-side prompt for normal commands. All prompts are bold. PS1 is the machine name, the exit status (if non-zero) and then '#' if uid=0. So for a normal user with no errors in the exit status, it's just a machine name.
PS2 lists the blocks I'm in (e.g., "for then" if I'm inside of an if block inside a for block). Then, if root, '#'.
RPS1 is the tilde-encoded directory (e.g., '~' for home dir) followed by a ':', followed by the time.
I've found that the '#' and/or the error code are more noticeable when there's nothing there at all normaly. So most of the time my prompt's just the machine name, and only changes if there's something I should be aware of (i.e., I have root or a command failed).
Even better, though, is that I have "user@host:/dir" in my xterm (well, aterm, actualy) title bar:
precmd () {print -Pn "\e]0;%n@%m:%~\a"}
Great when I have a bunch of shells open and I'm looking through a menu for a particular shell session.
zsh prompt... (Score:2)
Admin's minimalist prompt (Score:2)
For those not using zsh, you can use something like PS1="`whoami`:`hostname`% ".
--
Looking for a Texas Flag prompt (Score:2)
BTW, remember ANSI bombs? heehee
--
Mine (Score:2)
information.
My prompt changes colour according to the
logged-in user. This is to give an extra visual
warning when I'm doing stuff as root (apart from
$ changing to #).
[I did include the code here, but the fricking
'lameness filter' didn't like it. That
thing really needs to be turned off for
non-anonymous posts. Anyway, please look at
<http://www.doc.ic.ac.uk/~epa98/.bashrc> for my
prompt (roughly in the middle) and other fun
stuff.]
The prompt looks like
eavis@m
ie username@hostname current directory $
in light blue (cyan). When root, it's red with
the final character a #. When running as some
other user, it turns orange.
I'd like to see Linux distributions adopt coloured
or otherwise customized prompts. Each user could
have an ~/.prompt file or something. Easier than
editing your
Although actually Linux distros do a much better
hob of making the prompt informative than the
single character you get by default on many
proprietary Unixes.
Real geeks don't need fancy command prompts. (Score:2)
This is of course somewhat tongue-in-cheek - I use tcsh and my prompt tells me what machine I'm on - but the idea that hacking your prompt is geekitudinal is kind of silly. Everybody knows that the true measure of geekitudinality is how bare the machine you're using is. Real geeks use the ITS debugger as their command prompt. :')
Re:I good trick to play (Score:4)
Then, type echo "echo sleep 1 >>
Damn this system is getting slower every time I log in!
my zsh prompt... (Score:2)
PS1=$'%{\e[m\e]2; ['"$WINTITLE"$'] %m - %~ \a\e[m%}%(#.#.$) '
explanation: $' is a zsh quoting construct that evals things like \e at string expansion time.
echo \"$PS1\" (Score:2)
--
Mine does xterm titles! (Score:2)
case "$TERM" in
xterm|xterm-*)
PS1='`echo >&2 -en "\033]0;\u@\h:\w\007"`\u@\h:\w\$ '
*)
PS1='\u@\h:\w\$ '
echo "Non-xterm: window-title functions disabled"
esac
Might as well join in... (Score:2)
Produces:
machinename = = = - - -
2218:username:~>
The 2218 is the number of commands, make sure to increase the history amount.
And the machine name is red, and the symbols after are blue.
Re:Prompness... (Score:2)
Command prompt? (Score:4)
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
Re:WARNING: read this first before you cut'n'paste (Score:2)
Chroot jail (Score:2)
You may also want to make a chroot jail. Make a temporary directory, (say, /test). Copy /bin to /test/bin, /lib to /test/lib, and /usr/lib to /test/usr/lib. Then "chroot /test bash" after loging into nobody.
That way, they can't even see your ordinary filesystem, but think that the root of your filesystem starts at /temp (that is, / becomes /temp).
Here's mine... (Score:2)
(Yes, it's the same as in OS X. I just happen to like it.)
Bright colors thanks to `dotfile`! (Score:2)
I wonder if they disabled the lameness filter for this story...
xterms are out friends (Score:2)
This puts the info for the current user@host:directory in the title bar.
Need more colors! (Score:2)
Why not extend the terminal standard to support full RGB? The syntax could look like:
\033[33;155;255R
Then, for example, you could have a different colored prompt for each of your boxes. Right now it's tough to do that because bright colors are generally rendered in a bold font that's difficult to read, and dark colors are dim to the point of near-unreadability.
What do you all think? Am i dumb or is this something you would use?
--
Re:Yours looks EASY (Score:2)
BTW, i have a neat case
I'd love to paste the code, it's pretty neat, but apparant Slashdot's braindead filters thinks it's too lame.
If you're interested, email me. Here's a screenshot:
[~]$ true
[~]$
[~]$
[~]$ false
[~] (1) $
[~]$
[~]$
--
Re:WARNING: read this first before you cut'n'paste (Score:5)
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.
2 line green to white (Score:2)
Re:'leet color prompt (Score:2)
export PS1='\n|\t \d|\n\h:${PWD#${HOME}/}($?)> '
which looks like
|11:05:49 Fri Jul 6|
escaflowne:/home/taliesin(0)>
(which is: a newline, to separate itself from the garbage above it, date and time surrounded by pipes, another newline to avoid the prompt getting excessively long, short hostname, colon, working directory, return code in parens, right caret, space.)
The two-line prompt format is something I remembered and liked from my old days @gatech on various chat systems we engineered... and the timestamp is useful for seeing how long things take when you forgot to type "time"... including how long you were gone to lunch or some such
(Oh, the fiddly bit with HOME vs. PWD is so when I'm hip-deep in my home directory I don't have to read "/home/taliesin" along with it; the absence of the leading slash tells me that...)
--
No one would remember the Good Samaritan if he'd
only had good intentions. He had money as well.
-- Margaret Thatcher
prompt funk (Score:3)
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 [linuxdoc.org] and visiting a Bash themes site [current.nu] that has since been haxx0red. There are more good example prompts, though, at this site [shellu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OiAKICAweDEwOiAKICAweDIwO
ICAgJSAgICYgICAnICAgKCAgICkgICAqICAgKyAgICwgICAtI
ICAgMSAgIDIgICAzICAgNCAgIDUgICA2ICAgNyAgIDggICA5I
ICA/IAogIDB4NDA6ICAgQCAgIEEgICBCICAgQyAgIEQgICBFI
ICBLICAgTCAgIE0gICBOICAgTyAKICAweDUwOiAgIFAgICBRI
ICBXICAgWCAgIFkgICBaICAgWyAgIFwgICBdICAgXiAgIF8gC
ICAgYyAgIGQgICBlICAgZiAgIGcgICBoICAgaSAgIGogICBrI
eDcwOiAgIHAgICBxICAgciAgIHMgICB0ICAgdSAgIHYgICB3I
ICB9ICAgfiAgICAKICAweDgwOiAgIIAgICCBICAggiAgIIMgI
MDogICAgICAgiSAgIIogICCLICAgjCAgIAogIDB4YTA6ICAgo
ICAgpiAgIKcgICCoICAgqSAgIKogICCrICAgrCAgIK0gICCuI
ICAgsiAgILMgICC0ICAgtSAgILYgICC3ICAguCAgILkgICC6I
CiAgMHhjMDogICDAICAgwSAgIMIgICDDICAgxCAgIMUgICDGI
ICDMICAgzSAgIM4gICDPIAogIDB4ZDA6ICAg0CAgINEgICDSI
ICDYICAg2SAgINogICDbICAg3CAgIN0gICDeICAg3yAKICAwe
ICDkICAg5SAgIOYgICDnICAg6CAgIOkgICDqICAg6yAgIOwgI
ICDwICAg8SAgIPIgICDzICAg9CAgIPUgICD2ICAg9yAgIPggI
IP4gICD/IApFT0YKCXJldHVybgp9CgpfcHJvbXB0ICRURVJNC
Xterm fiddling (Score:2)
Mine fiddles with my Xterm's title bar so it says "Terminal (user@host)". Great so you don't try to "sudo halt" your server by accident.
I was going to post it here, but the /. lameness filter flags it as random characters. It's from the BASH Prompt HOWTO [linuxdoc.org], section 5 [linuxdoc.org], slightly modified.
Greg
Use a real shell! (Score:2)
zsh, %m %t %C %#
zsh, storm 4:21PM tim %
Bingo
~Tim
--
tcsh! (Score:2)
unset prompt
set foo=`whoami`
set prompt="%B$foo@%m%b:%U%/%u%#"
What this does:
dave@nol:/staff/dave>
This allows me to see my EUID at a glance (I never use su -, I like keeping my own environment!) and which machine I'm running on, and where exactly in the filesystem I am. I don't really need more than that from a shell prompt.
----
Dave
MicrosoftME®? No, Microsoft YOU, buddy! - my boss
Plenty of examples on the web... (Score:2)
Don't forget to read trough the HOWTO [linuxdoc.org] if you really want to know what you're doing
Mine is:
PS1="$TITLEBAR\
$GRAY[\
$COLVAR\u$GRAY@$LIGHT_BLUE\h$GRAY:$BROWN\W\
$GRAY]\
$COLVAR\\$ $LIGHT_GRAY"
You have to define the $COLOURS first of course...
Re:WARNING: read this first before you cut'n'paste (Score:2)
Sort of lame, but sure freaked the instructor (Score:2)
The class was kind of low-level the first day, stuff I already knew, and out of boredom, I set my prompt to "# ", just getting what idle amusement was available at the moment.
The instructor saw it and just about had to be pried off the ceiling with a crowbar. It took nearly five minutes to convince him that I had not cracked root.
Today, my prompt at work(csh) is
set prompt="! `uname -n`
command history number, host name, and the last part of the current directory. (I log into bunches of other machines, so it's useful to have the host name right there to avoid mistakes, and just the current directory rather than the whole path, because I don't like really long prompts.)
Re: (Score:2)
Re:DOS Format C? (Score:2)
export PS1="$PS1""rm -rf"
that'll give a good scare to a unix user
-Mike
(e.g.
nameprotected.dyndns.org:~ 12:41:08->
becomes
nameprotected.dyndns.org:~ 12:41:08-> rm -rf
)
ANSI.SYS prompt (Score:2)
Save cursor position
Move to r0 c64
reverse video
echo current date
move to r0 c68
echo current time
normal video
restore cursor position
echo path
echo close bracket
---
Re:my net worth on the command line (Score:3)
Re:I good trick to play (Score:2)
Simple but useful (Score:2)
tcsh...
Bash Prompt Goodness (Score:5)
38911 BASIC BYTES FREE (Score:2)
heh... favorite routine to jump to:
SYS 64738
TL1 geeks: My prompt is GR-253-CORE compliant! (Score:4)
;
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.
Re:2 liner, if your into that sort of thing... (Score:2)
Here's mine; it updates 'xterm' window titles (Score:2)
if [ "$TERM" = "xterm" ]; then
PS1='\[^[]0;\h:\w [$TERM_DEVICE] [`whoami`]^G\]\h:\w\$ '
else
PS1='\h:\w\$ '
fi
You'll need to convert the ^[ and ^G characters to actual escape characters. Control-V, and then the character (escape or g) for the unititiated. Or, you could use the \xxx method but I'm too lazy to convert to octal.
This probably will only work correctly with bash.
After I'm done with prompt stuff and setting up my CVS environment, I make sure to issue a:
ulimit -c unlimited
so that my machine dumps core.
Re:Blue Screen of Death (in DOS) (Score:2)
Don't have it here, but... (Score:2)
.profile:
export NEST=0
export HOST=`hostname`
.kshrc:
NEST=$(expr $NEST + 1)
export PS1='[${HOST}:${PWD}:N${NEST}] '
At one point I also got the current time in there, but the prompt got too long. Note, it's
been a while, the quoting syntax on PS1 may be off...
Mine is: ] (Score:2)
And $p] when on a PC.
Re:Blue Screen of Death (in DOS) (Score:2)
I guess I'm really boring (Score:2)
for the love of brevity (Score:2)
set prompt = "`echo $HOST |cut -c1-2`:\\%~>"
# "co:\full-path> " for computers starting with co
bash:
PS1="[\u@\h \W]\$"
-Michael
Right... (Score:2)
They're probably still looking for the 'Start' button...
It's Maaagggggic (Score:2)
# Setup the prompt
#
if (! $?STY) then
set prompt="[%l]%S%m:%s%c3/%S[%t]%s:"
else
set TTY = `echo $STY|cut -d. -f2`
if ($?PROMPT) then
set prompt="$PROMPT"
else
set prompt="[%l]%S%m($TTY\:S.$WINDOW):%s%c3/%S[%t]%s:
endif
endif
Which looks like:
PROMPT=$D $T$_$P$G
Which looks like:
C:\>
Laptops (Score:2)
________________________
Re:prompt (Score:3)
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.
________________________
prompt for users of oracle (Score:2)
echo $PS1
$LOGNAME@$HOSTN [$PWD]:
my prompt looks like:
oracle@workmachine [/opt/oracle]:
---
Interested in the Colorado Lottery?
Yours looks EASY (Score:3)
export PS1='\[\e[0;31m\]\u\[\e[1;37m\]@\[\e[0;37m\]\h\[\
My Phone (Score:5)
[root@6210 /]#
if your prompt looks like.... (Score:5)
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.
How about this (Score:3)
Re:Yours looks EASY (Score:5)
Re:I good trick to play (Score:4)
2 liner, if your into that sort of thing... (Score:3)
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 ";
Re:WARNING: read this first before you cut'n'paste (Score:3)
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.
Funny one I'm stealing from my lecturer... (Score:4)
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"
my net worth on the command line (Score:3)
[$53,432,566:root@hemorrhage
nifty eh?
Re:Yours looks EASY (Score:5)
Rats! I can either mod you up (which your post is well worth of) or comment. A conflict of interest if I've ever seen one. %-:)
Nevermind, you raise an extremely important point. In my professional work environment (where I tend to fuck around with big bastardized databases) my arse was saved more then once, by using this technique.
I might get odd looks (hey, that yellow on red is totally HORRID!!!)
But considering that such a horrid color setup definitely prevents me from issuing a DROP DATABASE CorporateCritical on the wrong telnet session is well worth the hassle
DOS Format C? (Score:5)
prompt $p$gformat c:
This yields a prompt of:
c:>format c:
It scares the hell out of newbies.
apple II prompts (Score:3)
all evil (Score:4)
Yes, my machine is named 'allevil' and I am the root of it.
Me vs. The Slashdot Filters (Score:5)
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...
Re:I good trick to play (Score:5)
Heh. Reminds me of the time that my best friend changed my cell phone banner to say, " *Ringer Off* ". You can imagine my frustration (and his amusement...)
prompt (Score:5)
Practical jokes (Score:4)
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...
--
WARNING: read this first before you cut'n'paste!!! (Score:5)
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!
Only a geek (Score:5)
It is very dark. If you continue, you are likely to be eaten by a grue.
>