Slashdot Mirror


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>"

568 comments

  1. Re:prompt by Anonymous Coward · · Score: 1

    that'd be "prompt $p$g" if I remember correctly.

  2. Re:if your prompt looks like.... by Anonymous Coward · · Score: 1

    If your prompt looks like this:

    #

    You miss that ole' 1970s OS so you want it back so you can smoke weed and not bathe for weeks. And you even call the 1970s technology "new" in public forums. Oh, and you can't make a post without obscenities, so you will reply to this full of obscenities. You are the kind that insists on "skins" for all windows apps, to make them unusable. You used to complain about Win16 being a "Windows on DOS" operating system, yet you don't seem to see how close X-Windows is to that concept. .

    If your prompt looks like this:

    c:\>

    At least you are interested in getting your work done and you cut your hair and bathe every now and then. And you realize that the best tool is the one that gets the job done, not the one that works best.

  3. But the good stuff is gone by Anonymous Coward · · Score: 1

    Notice, the site that Gile's page refers to, http://bash.current.nu/ is gone, hacked. Hope to see it back soon, and complete. BUT, there is another site that actually has the bashprompt package at http://www.neuro.gatech.edu/users/cwilson/cygutils /unversioned/bashprompt/, but that one is so old it refers to the bash.current.nu page before they even got thier own homepage.

  4. you nerds by Anonymous Coward · · Score: 2

    get a life

  5. Re:Root prompt by Anonymous Coward · · Score: 2

    Do not run this command - it tries to change the permissions of your /etc directory (no, it did not succeed with me).

  6. Re:prompt by Anonymous Coward · · Score: 2

    Mmm... too much C++ and ZeroWing will do this to you...
    set prompt='All your argv[]s are belong to us: '

  7. Overkill - I love my prompt by Zack · · Score: 1
    bash: PS1="\[\033[0;36m\]\u\[\033[1;36m\]@\[\033[0;36m\] \h \[\033[1;36m\](\[\033[0;36m\]`date +%r'\[\033[1;36m\])'\('\[\033[0;36m\]'%D'\[\033[1; 36m\]'\)`(\[\033[0;36m\]pts/8\[\033[1;36m\])(\[\03 3[0;36m\]BG: $(jobs | grep -c [0-9])/$(jobs | grep -c Runn)\[\033[1;36m\])\n\[\033[0;37m\]\w$"

    What it looks like:
    me@machine (01:53:11 PM)(07/06/01)(pts/8)(BG: 0/0)
    $

    Time, date, terminal,number of backgrounded jobs, and number of backgrounded jobs that are running. It's a little on the complex side, but I like it. All the funky escape codes change the colors (so it works best with a white text on black background)


    -- Zack

  8. Re:all evil by Zack · · Score: 1

    I think the quote is "The LOVE of money is the root of all evil." Not "Money is the root of all evil."

    Somewhat different.

    -- Zack

  9. Re:Yours looks EASY by Jeremiah+Cornelius · · Score: 1
    I wear two-tone brogues and a red shirt, you know this is wrong...

    But the main thing is- unless your a fool-

    Oh, you know,

    Yeah, you know, yeah, you know,

    Man, you got to be cool...

    - Jeremiah Cornelius Still a Face in my Sun Microsystems shirt!

    --
    "Flyin' in just a sweet place,
    Never been known to fail..."
  10. Mine: Lots of info, lots of colors. Link to code by Erich · · Score: 3

    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

  11. Re:Me vs. The Slashdot Filters by mosch · · Score: 1
    Same problem here. Apparently the first thing I did, at the unix 'epoch', was immediately post to slashdot.

    Slashdot: for all your self-rightous, hypocritical news!

    --

  12. Color is good. by Mike+Hicks · · Score: 2

    Hmm, in trying to post this, I came across a `lameness filter'. Probably a good idea in most situations, but this post contains a lot of the `junk characters' that it's complaining about. Maybe I just need to fill up some space with real words to offset whatever algorithm you guys are using to determine what shouldn't be posted.

    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 /etc/bashrc:


    [ -f /etc/jjcolors ] && . /etc/jjcolors
    if [ "$EUID" = "0" ]; then
    PS1="$BRIGHT$BLUE[$RED\u$WHITE@\h$BLUE][$YELLOW\ w$ BLUE]$RED\\$ $NORMAL"
    else
    PS1="$BRIGHT$BLUE[$CYAN\u$WHITE@\h$BLUE][$YELLOW \w $BLUE]$CYAN\\$ $NORMAL"
    fi
    [ -f /etc/jjcolors ] && . /etc/jjcolors unset


    In my /etc/jjcolors:


    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

    --

    1. Re:Color is good. by Mike+Hicks · · Score: 2

      Heh, it's there. Slashdot's comment system just divided it into chunks, to prevent people from putting really long lines in and screwing up the tables.

      There should only be a single space in the prompt, between '\\$' and '$NORMAL'
      --

    2. Re:Color is good. by Mazzella! · · Score: 1

      Looks like there is a $ missing in the first PS1 for root... [ -f /etc/jjcolors ] && . /etc/jjcolors if [ "$EUID" = "0" ]; then PS1="$BRIGHT$BLUE[$RED\u$WHITE@\h$BLUE][$YELLOW\w$ $BLUE]$RED\\$ $NORMAL" else PS1="$BRIGHT$BLUE[$CYAN\u$WHITE@\h$BLUE][$YELLOW\w $BLUE]$CYAN\\$ $NORMAL" fi [ -f /etc/jjcolors ] && . /etc/jjcolors unset

      --
      1.3L, 3 moving parts, 280 HP, no Turbos, wanna Race? RotaryNe
  13. VGA lines without vga font by Mike+Hicks · · Score: 2

    It occurs to me that the linux console and most xterms can switch in and out of a pseudo-vga mode where they can draw line characters to the screen using a standard iso8859-1 font. That's how `make menuconfig' and other menu-driven programs get line characters on the screen.

    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).
    --

  14. ah, why the hell not... by zztzed · · Score: 1

    On the various *nix machines I use where I can use zsh (yay programmable completion!):
    [arianne:~] michael% echo $PROMPT
    [%m:%~] %n%%

    Or, in case of bash:
    [arianne:~] michael$ echo $PS1
    [\h:\w] \u\$


    On Windows:
    C:\WINDOWS>echo %PROMPT%
    $p$g


    --

  15. Two-liner by Scott+Wunsch · · Score: 1

    [scott@pytheas] [pts/4] [~]
    [0] [213] %

    I use a two-line prompt. Why? Because I can have a really long directory name, and there's still room to type a decent command line without running off the edge of the screen!

    (There's actually colour to it too, but I won't post the actual prompt definition, because it's full of literal escape sequences. I knew memorising all those ANSI codes would pay off someday! :-))

    --
    \\'
  16. Re:Chaneges color when uid=0? by Scott+Wunsch · · Score: 1

    Okay, fine, maybe I will post my actual prompt. It actually does that; the username root will turn up in red; everybody else is cyan. This requires zsh, of course :-).

    PROMPT='%{ESC[0;1;37m%}[%(0#.%{ESC[31m%}.%{ESC[3 6m %})%n%{ESC[37m%}@%{ESC[36m%}
    %m%{ESC[37m%}] [%{ESC[36m%}'${ttyprefix}'%l%{ESC[37m%}] [%{ESC[36m%}%~%{ESC[37m%
    }]
    [%(0?.%{ESC[32m%}.%{ESC[31m%})%?%{ESC[37m%}] [%{ESC[36m%}%!%{ESC[37m%}] %{ESC[33
    m%}%# %{ESC[22;36m%}'

    POSTEDIT='ESC[0m'

    --
    \\'
  17. Re:this is just absurd by Scott+Wunsch · · Score: 1
    IMO, doing stupid shit like this shows your ignorance even more. Woohoo! I changed my command-line, big f*g deal. That's takes about as much skill as it did changes the text in old DOS programs. (Open it up in a hex-editor and start modifying strings.)


    You're right; it doesn't necessarily show any particular skill. But did you ever consider that it might be useful? My prompt tells me a lot more than the default one does, and I find that useful. I like seeing other people's prompts, because it gives me ideas of useful information that I could include in mine.



    Is that a bad thing?

    --
    \\'
  18. I like mine chock full of goodness! by jandrese · · Score: 2

    I use zsh, and I rather like having all of the information I need right on the command prompt. Many things only appear if they are needed (return values from programs for instance) and the prompt string avoids getting too long to leave me room to work my magic:
    %(!.%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 .../X11R6/share/xmame):

    Down that path lies madness. On the other hand, the road to hell is paved with melting snowballs.

    --

    I read the internet for the articles.
    1. Re:I like mine chock full of goodness! by jandrese · · Score: 2

      Oh yeah, this is at home. At work in the lab I make a slight modification:
      (int the .zshrc)
      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.

      --

      I read the internet for the articles.
  19. Re:prompt by jbuhler · · Score: 2

    I get strange looks from my friends for this one:

    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.

  20. Re:this is just absurd by Have+Blue · · Score: 2

    Note that that is the FIRST tutorial. What was the first program you ever wrote? Hello world?

    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.

  21. My prompt (yes this is really old) by Have+Blue · · Score: 3

    C:\> C:\spot> C:\spot>run run spot run!

    1. Re:My prompt (yes this is really old) by duckie13 · · Score: 1

      Lisa: My family never talks about library standards and every time I try to steer the conversation that way they make me feel like a nerd.

      CBG: We are hardly nerds, would a nerd wear such an irreverent sweatshirt?

      Lisa: (Reading sweatshirt)
      C:/DOS
      C:/DOS/RUN
      RUN/DOS/RUN
      Ha, only one person in a million would find that funny.

      Frink: Yes, we call that the Dennis Miller ratio.


      Gotta love those Simpsons :D

      ----------

      --
      "My days are less enjoyable because of people." ~ Johnny the Homicidal Maniac
  22. Tcsh prompt from hell.. by Loki · · Score: 1

    set promptchars = '%>'
    set out='0;37m'
    if $?SSH_CLIENT then
    set in='0;31m'
    else
    set in='0;36m'
    endif
    if ($term == xterm ) then
    set prompt = "%{\e]0;`whoami`@%m:%l: %/\007%}%{\e[${out}%}[%{\e[${in}%}%?%{\e[${out}%}: %{\e[${in}%}$SHLVL%{\e[${out}%}][%{\e[${in}%}`whoa mi`@%m%{\e[${out}%}:%{\e[${in}%}%l%{\e[${out}%}]%{ \e[${in}%}%/%{\e[${out}%}%#%{\e[0;0m%} "
    else
    set prompt = "%{\e[${out}%}[%{\e[${in}%}%?%{\e[${out}%}:%{\e[${ in}%}$SHLVL%{\e[${out}%}][%{\e[${in}%}`whoami`@%m% {\e[${out}%}:%{\e[${in}%}%l%{\e[${out}%}]%{\e[${in }%}%/%{\e[${out}%}%#%{\e[0;0m%} "
    endif

    [0:5][root@eris:pts/6]/root>

    [returncode:shlvl][user@host:tty]path
    It's red for ssh logins, else it's cyan.
    Does the xterm titlebar too.

  23. fwiw by sabi · · Score: 1
    On zsh; this is pretty simple:

    RPROMPT=' %B%t%b'
    prompt="{%U%n#%l@%m:%h%u} %30<...<%~%#"

    if [[ $TERM == "*term*" || $TERM_PROGRAM = "Apple_Terminal" ]] {
    xterm_prompt=1
    prompt="[%U%l:%h%u] %~%#"
    }

    chpwd() {
    [[ -t 1 ]] || return
    if [[ -n $xterm_prompt ]] {
    print -Pn "\e]2;${USER}@${HOST}:%~\a"
    }
    }

    On tcsh; this is complicated because it uses both xterm and xwsh titles and has to work with an oh-so-lame shell:

    if ( $?DISPLAY || $term == xterm || $term == Apple_Terminal || $term == xterm-color ) then
    if ( $term == iris-ansi ) then
    # need to use ]2 because xwsh doesn't support ]0 to change
    # both window and icon titles...
    setenv XTERM_TITLE_ESCAPE '2'
    else
    setenv XTERM_TITLE_ESCAPE '0'
    endif
    setenv XTC1 "alias cwdcmd '/bin/echo \042\\033]${XTERM_TITLE_ESCAPE};${USER}@${HOST}:"
    setenv XTC2 '$\0573cwd:s|'
    setenv XTC3 "${HOME}|~|"
    setenv XTC4 '\0575\\007\\c"'
    setenv XTC5 "'"
    # these actually work, but... whatever... I've spent about 4 hours on this line so far.
    #setenv XTC "alias cwdcmd '/bin/echo \042\\033]${XTERM_TITLE_ESCAPE};${USER}@${HOST}:\0 44\0573cwd:s|${HOME}|~|\0575\\007\\c\042'"
    #setenv XTC "alias cwdcmd '/bin/echo \042\\033]${XTERM_TITLE_ESCAPE};${USER}@${HOST}:\0 44\0573cwd:s|${HOME}|~|\0575\\007\\c\042'"
    eval `echo "${XTC1}${XTC2}${XTC3}${XTC4}${XTC5}"`
    set prompt="[%U%l:%h%u] %B%t%b %~%#"
    # set prompt = "%{%}%h-%~/%# "
    cwdcmd
    else
    set prompt="{%U%n#%l@%m:%h%u} %B%t%b %~%#"
    # set prompt = "%h-%m/%~/%# "
    endif

    Why, oh why, oh why does Slashdot not support <PRE>? I wish I knew.
    --

    1. Re:fwiw by sabi · · Score: 1

      Hm, you've got a point. Slashdot could always just post-process it to limit to 80 chars or something; I wouldn't mind that.

      But that would be TOO HARD.

      *shrug*
      --

  24. Re:I good trick to play by Paul+Komarek · · Score: 2

    This isn't really funny. I bet you're the type that watches America's Funniest Home Videos hoping to see someone get hurt.

    -Paul Komarek

  25. Re:KSH Prompt? by Dom2 · · Score: 2

    Ksh will expand environment variables when it diplays, so you can do:

    PS1='$PWD$ '

    (Note the single quotes)

    -Dom

  26. CVS for your init files - and a project idea by Bryan+Ischo · · Score: 2

    I can't post my .profile since I don't have one (I use .bashrc, etc), but it's not that interesting anyway ... the only interesting thing about it is that it's split up into a .bashrc (and .bash_login, etc) and .bashrc.local (and .bash_login.local, etc). The .local files are for local system settings, the rest are "generic" settings that should work under any *nix.

    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.

  27. I good trick to play by smartin · · Score: 5

    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.
    1. Re:I good trick to play by Niac · · Score: 1

      rm -- -rf
      "We have the right to believe at our own risk any hypothesis that is live enough to tempt our will."

      --
      http://gabrielcain.com/
    2. Re:I good trick to play by Niac · · Score: 1

      Very true.

      Thanks for that.


      "We have the right to believe at our own risk any hypothesis that is live enough to tempt our will."

      --
      http://gabrielcain.com/
    3. Re:I good trick to play by Tet · · Score: 2
      rm -- -rf

      This only works with the rm in GNU fileutils. Traditional Unix rm mostly used

      rm - -rf
      Even that didn't work on all versions of Unix. The only way to be sure was to provide a path to the file:
      rm ./-rf
      --
      "The invisible and the non-existent look very much alike." -- Delos B. McKown
    4. Re:I good trick to play by Tet · · Score: 3
      Change someone elses prompt to "". Drives them crazy until they figure it out.

      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...

      --
      "The invisible and the non-existent look very much alike." -- Delos B. McKown
    5. Re:I good trick to play by noahm · · Score: 1

      I once saw a user on a lab machine whose prompt was
      this-user-left-herself-logged-in-to-[machine]-on -[ date]

      The sad sad sad thing was that I saw the same user a couple months later and they had not changed their prompt. She was a computer science grad student.

      noah

    6. Re:I good trick to play by PD · · Score: 4

      If they leave their system for just a minute, first send an e-mail to everyone in the company saying "This is Joe's computer. Joe left me logged in. Joe shouldn't have done that."

      Then, type echo "echo sleep 1 >> .profile" >> .profile

      Damn this system is getting slower every time I log in!

    7. Re:I good trick to play by Shadarr · · Score: 1

      We did a similar thing at work. The manager has shortcuts all over her desktop so we took a screenshot and removed all the icons. All of a sudden she couldn't launch anything.

    8. Re:I good trick to play by Black+Parrot · · Score: 1

      > Change someone elses prompt to "". Drives them crazy

      Wandering slightly off topic...

      We used to set up a desktop with lots of application icons sprinkled all over it, take a full-screen screenshot of it, set people's un-attended computers to use that screenshot for wallpaper, and then sit back to watch them click on the wallpaper trying to make the applications pop up.


      --

      --
      Sheesh, evil *and* a jerk. -- Jade
    9. Re:I good trick to play by cyberdonny · · Score: 2

      Even better: also create a file named -rf to go along with it. Ironically, the -rf file will be the only one that won't be wiped...

    10. Re:I good trick to play by ChristTrekker · · Score: 1

      Reminds me of when I was working the help line at my university. One day as I was sitting in the lab, someone left their VAX terminal logged on. I did my standard email-to-self, "This is your conscience reminding you to log out when you leave," and also added a login file to change the normal "$" prompt to be the user's first name. Then I logged the user out.

      A former roommate, who worked a different shift in the lab, said this person showed up the next day and freaked out. Couldn't figure out where the "$" went and thought her account was broken. I guess she didn't realize that all her commands worked the same as before.


      I have zero tolerance for zero-tolerance policies.

    11. Re:I good trick to play by cybermage · · Score: 2

      Oh, well if you've got users to torture, try aliasing some common commands on them, like this:

      alias rm echo "Sorry, but No! Request sent to your boss"
      alias mv echo "Won't budge, press any key to delete."

    12. Re:I good trick to play by rdejean · · Score: 4

      my favorite is to change their prompt to: PS1="Login incorrect\n\nlogin: "

    13. Re:I good trick to play by DeeKayWon · · Score: 1

      Why not go farther? Create a shell script with the same name as the user:

      #!/bin/sh
      echo "Invalid username\n"

      So you get:

      login: user
      password:
      Login incorrect

      login: user
      Invalid username
      Login incorrect

      login:

    14. Re:I good trick to play by Zero+Sum · · Score: 1

      Even better is to just clear the screen. They think the monitor/teminal is broken.

      --

      Zero Sum (don't amount to much). [root@localhost]

    15. Re:I good trick to play by Zero+Sum · · Score: 1

      If you are ito those sort of games, create a file with the name "free\bd". It will show as "fred" in an ls (wihout the display all chars option).

      --

      Zero Sum (don't amount to much). [root@localhost]

    16. Re:I good trick to play by Zero+Sum · · Score: 1
      Ermm... I use ksh. Without TENEX extensions. I never liked command completion when I first encountered it in the '70s so I have never used it.

      Does everybody else use it nowadays?

      --

      Zero Sum (don't amount to much). [root@localhost]

    17. Re:I good trick to play by Technician · · Score: 2
      I always liked "DIVIDE BY ZERO ERROR SYSTEM HALTED"

      Guess how many times they rebooted before they found out nothing was wrong.

      --
      The truth shall set you free!
    18. Re:I good trick to play by John+Harrison · · Score: 1

      "Battery Dead" works well on people who have just bought a phone and don't understand the battery meter yet.

    19. Re:I good trick to play by American+AC+in+Paris · · Score: 5
      Change someone elses prompt to "". Drives them crazy until they figure it out.

      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...)

      --

      Obliteracy: Words with explosions

    20. Re:I good trick to play by Rytsarsky · · Score: 1

      In high school, I sometimes changed teachers' dos prompts to something like "Press any key to continue formatting C: ".

      --
      God became man to enable men to become sons of God. -C.S. Lewis
    21. Re:I good trick to play by infinite9 · · Score: 2

      I once opened a bunch of questionable programs and MS word documents on a friend's machine. Filled the screen. Then I copied the screen to the clipboard and saved it as a bitmap through paint. Then I set the wallpaper to that bitmap. He had a hell of a time trying to close all those windows. :-)

      --
      Disconnect your television. Do your own research. Draw your own conclusions. They're probably lying. Don't be a sheep.
    22. Re:I good trick to play by flewp · · Score: 1

      Cheesy Q-basic programs were fun back in middle school. A fake C:\ prompt, then either a lot of beeping and messages saying the computer was about to crash, or a lot of beeping and a fake porn bbs screen. *THAT* got the teacher's attentions.......

      --
      WWJD.... for a Klondike bar?
  28. Just the basics by Chacham · · Score: 2

    PS1='\w>'

    ---
    ticks = jiffies;
    while (ticks == jiffies);
    ticks = jiffies;

  29. Something like this by Chacham · · Score: 2

    select user_id, lower(username) user_name from user_users where username = user; select lower(substr(global_name,1,(instr(global_name,'.', 1,1)-1))) db_name from global_name; rem set the prompt set sqlprompt "&db_name::&user_name> "

    ---
    ticks = jiffies;
    while (ticks == jiffies);
    ticks = jiffies;

  30. My bash prompt. by j.e.hahn · · Score: 2

    Here's how I set it in /etc/profile on all my boxen:

    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 /home/jeh/foo/bar/bletch)
    >

    and as root

    (1 root myhost /usr/local/lib/perl/5.6.1)
    >>

    So I can tell at a glance exactly who and where I am, and still have nearly a full screen width for commandline editing.

  31. Re:See my post on The Other Site by Phil+Gregory · · 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/. Enjoy.



    --Phil (Yep, I'm replying to one of my own posts.)
    --
    355/113 -- Not the famous irrational number PI, but an incredible simulation!
  32. See my post on The Other Site by Phil+Gregory · · Score: 3

    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!
  33. perl fun by dirt · · Score: 1
    a few years ago i made this script; it works even though i wrote it when first learning perl.

    the lameness filter makes this really difficult, so these aren't my favorite but they work.

    export PS1='\[\033[1;30m\]--\[\033[0;36m\][\[\033[0;37m\] \d \t \!\[\033[0;36m\]]\[\033[1;30m\]--\[\033[0;37m\]\n\ [\033[1;30m\]--\[\033[0;36m\]]\[\033[0;37m\]\h\[\0 33[1;37m\]:\[\033[0;37m\]\w\[\033[0;36m\][\[\033[1 ;30m\]--\[\033[0;37m\] '
    --[Fri Jul 6 08:44:52 333]--
    --]ceylon:~[--

    export PS1='\[\033[0;36m\][\[\033[1;30m\]+\[\033[0;37m\]\ u\[\033[1;30m\]+\[\033[0;37m\]\h\[\033[1;30m\]+\[\ 033[0;36m\]]\[\033[0;37m\]\n\[\033[0;36m\][\[\033[ 1;30m\]+\[\033[0;33m\]\w\[\033[1;30m\]+\[\033[0;36 m\]]\[\033[0;37m\] '
    [+dirt+twist+]
    [+~+]

    i had more, but man, the lameness filter is pretty lame.

    ---

    --

    ---
    You are not what you own -- Fugazi, "Merchandise"
  34. "PROMPT $P$G" in Bash! by dse · · Score: 1

    Try this in GNU Bash. Maybe on an unsuspecting friend. :)

    PROMPT_COMMAND='_pwd=`echo $PWD|\
    sed "s:/:\\\\\\\\:g;\
    y:abcdefghijklmnopqrstuvwxyz:\
    ABCDEFGHIJKLMNOPQRSTUVWXYZ:"`'
    PS1='C:$_pwd> '


    --
    Darren Stuart Embry

  35. Re:mine by Nail · · Score: 1

    I use that on bash, and this in tcsh:

    set prompt='[%n@%m %B%~%b]%% '

    to get me the same thing (except %B and %b bold (and unbold) the current directory).

    It answers almost everything want to know before I type a command: "who am I?", "what machine am I on?", and "where am I in the file system?".

    I use it on most systems I use. At work, however, I keep a very spartan root prompt ('# ') to remind me that I should double check everything I do as root. And I do.

    --
    ...yellow number five, yellow number five, yellow number five...
  36. prompt by Arlo · · Score: 1

    set prompt="%m %B[%t]%b %n [%/]%#"

    tcsh.

    1. Re:prompt by Yakko · · Score: 1
      but I could never stand my full path in my prompt. Too long.

      Then instead of "\w" use "\W" which will only display the last component of your PWD. This works for bash, of course.



      --

      --

      --
      Me spell chucker work grate. Need grandma chicken.
    2. Re:prompt by divbyzero · · Score: 1

      pushd and popd?
      But my grandest creation, as history will tell,

      --
      But my grandest creation, as history will tell,
      Was Firefrorefiddle, the Fiend of the Fell.
    3. Re:prompt by imagi · · Score: 1

      Zsh Rules: PROMPT="%{$COLOR3%}[%{$COLOR1%}%n%{$COLOR3%}@%{$CO LOR1%}%m%{$COLOR3%}[%{$COLOR1%}tty%l%{$COLOR3%}]%{ $COLOR1%}%~%{$COLOR3%}]%{$COLOR1%}%(#.#.$)%{$COLOR 4%}

    4. Re:prompt by Ishtar · · Score: 1

      Yeah! tcsh!

      %T %m:%~%#
      19:46 monolith:~>

      That's mine!

      --
      Hardware, n.: The parts of a computer system that can be kicked. -- nn.
    5. Re:prompt by GavK · · Score: 1
      A Simpler version (And what I use) is:

      "[`uname -n`]`whoami`: "

      I switch machines and users a lot...

      I also have a DBA friend (Hi Dave) who's prompt is "out of cheese error"

      --

      Gav

      "There's no such thing as data that can't be manipulated"

    6. Re:prompt by lizrd · · Score: 3
      If you've transferred to Linux recently and want to the the old C:\> look back you could try this one:

      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.
    7. Re:prompt by Trepalium · · Score: 1

      Actually it doesn't tell you service pack, only revision and build (which is constant through the entire release cycle -- service packs don't modify it). It would only be useful if you were beta testing, and might be something MS developers use internally.

      --
      I used up all my sick days, so I'm calling in dead.
    8. Re:prompt by malfunct · · Score: 1
      This could be useful if you had a mix of nt4 and win2k servers in your farm. You could tell at a glance what ones were win2k.

      Honestly this should be a non-issue if you have resonable naming conventions. For instance there was always a different set of names for the nt4 boxes and the win2k boxes so you never mixed them up.

      --

      "You can now flame me, I am full of love,"

    9. Re:prompt by pi_rules · · Score: 2

      Alias a: and A: to a command that changes to /mnt/floppy (and perhaps mounts it) then changes your shell? Do the same with D: I suppose. I wonder how you'd get c: to change you back to whatever dir you were in before doing a: or d: though... and making a: and d: resume their last CWD under /mnt/whatever also. Might be fun to play with. Entirely useless -- but fun.

    10. Re:prompt by evilviper · · Score: 1
      You certainly don't need it to be part of your prompt... Just use VER if you need to find out.

      ---=-=-=-=-=-=---

      --
      Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
    11. Re:prompt by evilviper · · Score: 1
      The reason \w (or \W) needs to be in the prompt is because it is constantly changing. The version of windows, service packs, et al. will not change from moment to moment. Once you've run ver, you know exactly what you are using, and the system you're using isn't going to change out from under you. If you need the info to decide what system you are using, or what sericepack/bugfix to install, just use ver.

      ---=-=-=-=-=-=---

      --
      Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
    12. Re:prompt by Jasonv · · Score: 1

      My old DOS prompt was

      Yes, oh Master?

      Then using all those ASCII codes I had the path on the top left of the screen and the time on the top right.

      Hey - I never learned to program, so I had all that extra time to fiddle with ANSI codes and the prompt command!

    13. Re:prompt by CalcMan · · Score: 1

      That actually seems kind of cool. How did u make it do that? what path command did u use?

    14. Re:prompt by cygnusx · · Score: 1
      That's like saying... you can use pwd to get the cwd, why do you need \w in your PS1?

      If I'm switching through 12 different consoles running on boxes with different build IDs, the last thing I need is to type "ver" all the time.

      You certainly don't need it to be part of your prompt
      You -- the user -- doesn't. The developer or tester does.

      ____________________________
      2*b || !(2*b) is a tautology
    15. Re:prompt by ichimunki · · Score: 2

      That's nice, but not as nice as this two-liner:

      READY.

      With a flashing box under the R.

      --
      I do not have a signature
    16. Re:prompt by twistah · · Score: 1

      Speaking of Windows command prompts, Windows 2000 has the most useless variable for the DOS prompt command: $V

      It shows the current Windows version. Now, I don't understand how you could not know what version of Windows you are using, and as far as that goes, why would you need to have the version in a prompt!?

      And you think it spits something short out? Here is what it does:

      C:\>prompt $V

      Microsoft Windows 2000 [Version 5.00.2195]

      That was a "prompt $V [space]", and I got all that. If anyone has a real use for this, tell me what it is! ;)

      P.S: Windows kids, if you 'screwed up' your prompt, get your normal one back by typing prompt, or if that doesn't work, prompt $p$g

    17. Re:prompt by pruneau · · Score: 1

      Well, I did put `>` characters into my prompt until a spurious copy-paste trashed an important file because the middle-button paste somehow made the shell to redirect garbage into a real file... DO NOT EVER use > in your prompt, or it will bite you one day. And do not tell me you never did such a mistake...

      --
      [Pruneau /\o^O/\ warranty void if this .sig is removed]
    18. Re:prompt by HenryFool · · Score: 1

      #!/usr/local/bin/perl

      # I wrote this just now on my Solaris box.
      # Customize however you like..

      %drvltrs=("/dev/dsk/c0t0d0s0"=>C,
      "/dev/dsk/c0t0d0s7"=>D);

      foreach(`/sbin/mount`){
      split/ /,$_;
      $dirhash{$_[0]}=$drvltrs{$_[2]};
      }
      $wd=`/bin/pwd`;chomp $wd;
      foreach (sort {length($b)<=>length($a)} keys %dirhash) {
      $wd=~/^$_/&&($f=$_,last)
      }
      print $dirhash{$f};$wd=~s/^$f//;print ":$wd> ";

      # I wrote this to /usr/local/bin/dosprompt, then
      # in tcsh: set prompt = `/usr/local/bin/dosprompt`

      # Enjoy,
      # Henry Fool

    19. Re:prompt by HenryFool · · Score: 1

      Error correction..

      Make this your prompt in tcsh by typing:
      alias precmd /usr/local/bin/dosprompt
      set prompt=""

      Do it in bash by:
      PS1="\$(/usr/local/bin/dosprompt)"

    20. Re:prompt by Carpathius · · Score: 1
      Okay, mine is: PS1="-`uname -n`-> "

      But the path, now that's the fun thing. In xterms, my machine/path is always in the title bar, and when I vi a file, the filename gets added. Haven't found anyone else who likes that, but I could never stand my full path in my prompt. Too long.

      Sean.

    21. Re:prompt by FreeForm+Response · · Score: 1

      You could have a: or d: use pushd, and then c: use popd. Just an idea.

    22. Re:prompt by SCHecklerX · · Score: 1

      ln -s / c\: ln -s /mnt/cdrom d\:

    23. Re:prompt by rppp01 · · Score: 1
      Here is my prompt at home:

      you@cangoto /dev/null>$

      --
      They stuck me in an institution, said it was the only solution, to...protect me from the enemy, myself
    24. Re:prompt by shannara256 · · Score: 1

      From the October 1993 issue of PC/Computing (page 301, for those who actually still have it) (modified slightly):

      prompt $E[s$E[H$E[1;32;45m$E[K$E[1C$P$E[1;36;H$T$H$H$H$E[ 1;66H$D$E[0;37;40;m$E[u$p$g

      Note that there are no spaces in there (except after the initial "prompt"), contrary to the supreme all-knowningness of slashcode.

      -Jason-

    25. Re:prompt by bark76 · · Score: 2
      c:\>

      Mine used to say that, but now all I get is this blue screen :(

    26. Re:prompt by Brummund · · Score: 1

      Yeah, I mean, of what possible use could the current build of the OS be? Actually, if you're a tester and has 20 boxes with different service packs etc. hooked up on a single keyboard/screen switch, and you constantly swap back and forth, that's actually quite useful. (Especially if you're in console mode)

    27. Re:prompt by ProDeath · · Score: 1

      (ory~

    28. Re:prompt by nyxxie · · Score: 1

      Mine:

      NEMESIS [ntsh]>

    29. Re:prompt by paulpas · · Score: 1

      C:ENTER:###

      --
      -PMP-
  37. Re:Chaneges color when uid=0? by betaray · · Score: 1

    You can always put a different .profile in ~root, or add this to your /etc/profile:

    if [ "`id -u`" = "0" ]; then
    #setup root prompt
    else
    #setup user prompt
    fi

  38. 'leet color prompt by betaray · · Score: 4

    ph33r my prompt! Color, upper asci, username, machine and date!!!

    (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\ [\304\[\033[0;34m\[(\[\033[0;36m\[\u@\h\[\033[0;34 m\[)-(\[\0
    33[1;34m\[\`date +\"%a %B %-d %l:%M%P\"\`\[\033[0;34m\[)\[\033[1;34m\[\304\[\033 [0;34m\[\304\n\300[\[\033[0;36m\[\w\[
    \033[0;34m\[]:\[\033[0;0m\[ \[\033[10m"

    1. Re:'leet color prompt by warpeightbot · · Score: 2

      Bah. I prefer the Keep It Simple Stupid approach. No color, no fancy-ass highlighting, just when and where I am.

      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 :) As for all the mail/user/group stuff, that's what "id" and kbiff are for... and no color, because I occasionally use a dummy terminal to check mail (where I don't _need_ kbiff). Platform independent, obvious (except for the retcode), and useful. Suits me.

      (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

    2. Re:'leet color prompt by Phork · · Score: 1

      don't be hating on the top hat, the king of hats.

      --
      -- free as in swatantryam - not soujanyam.
    3. Re:'leet color prompt by entrigant · · Score: 1

      Rasterman is THE Enlightenment guy, no?

  39. lame - but effective by SiliconJesus · · Score: 1

    PS1="\H:\w# "

    Work at ISP with literally hundreds of UNIX boxen. This keeps it easy to type (we use kerb and login as root) and doesn't interfere with the other sysadmins preferences.

    Secret windows code

    --
    Clinton made me a Republican. Bush made me a Libertarian. Trump is making me question reality.
  40. my old-ass prompt by nickm · · Score: 1
    When I was in college, we used to all waste hours re-tinkering with our prompts. I finally ended up with the following, and have stuck with it (or a variation on it) for years:

    export PS1='\[\e[0;34m\][\[\e[1;34m\]\h\[\e[0;34m\](\[\e[ 1;34m\]\w\[\e[0;34m\])] \[\e[0;0m\]'
    if test $USER = "root" || test $LOGNAME = "root" || test `whoami` = "root" ; then
    PS1="\[\e[41m\]\[\e[1;33m\]ROOT: $PS1"
    fi

    that's for my server machine. My laptop uses this:

    export PS1='\[\e[0;32m\][\[\e[1;32m\]\h\[\e[0;32m\](\[\e[ 1;32m\]\w\[\e[0;32m\])] \[\e[0;0m\]'

    I use different colors for different machines. Makes life easier.


    --
    I noticed

    --

    --
    I noticed

    It's getting about time to leave everywhere

  41. Simple: 0:hostname:~$ by Kaz+Kylheku · · Score: 3

    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\$

  42. Re:Mine: Lots of info, lots of colors. Link to cod by jnik · · Score: 1
    LOL. Starts to sound like my MUD prompt, which covered about half the screen.

    For some reason I never customized my bash prompt half as much as the MUD. Maybe I should do that now...it would feel like old times.
    (hmmmm...now how do I get my current hitpoints in bash...)

  43. Bashprompt. by Da+w00t · · Score: 2

    Bashprompt, the original BASHISH was cool. I helped the project a little, providing screen captures of the themes, and making a theme of my own for bashprompt. Their server was recently cracked, and they've run out of funding. Lets all pitch in and save this project. Mods: mod this one up please, thx

    da w00t.

    --

    da w00t. mtfnpy?
  44. Re:Woo hoo! Another C shell user! by SJS · · Score: 1
    On one machine:

    set prompt = "%m %~ > "

    on another:

    set prompt='[%n@%m %c]$ '

    on another:

    set prompt = '[\!] %m %~ > '

    on another:

    set prompt = "Stremler> "

    on another:

    set prompt="[${SHLVL}]${HOST}% "

    Etc. Etc.

    Hm. All pretty simple.


    Fight the evil default empire of bash!


    Amen!
    --
    Pick One: http://www-rohan.sdsu.edu/~stremler/sigs/sigs.html (Note - disable Javascript first!)
  45. My prompt by Brian+Kendig · · Score: 2

    yes, master? ~

  46. My Zsh Prompts by juhtolv · · Score: 1


    Most of the time my Zsh-prompt looks like this:



    juhtolv@heresy : /home/juhtolv
    %



    And as a rewt it looks like this:


    -=*[ROOT ZSH]*=- root@heresy : /root
    #



    In both cases I have RPROMPT like this:



    10001 | pts/5



    My shell-configs are available here:



    http://www.cc.jyu.fi/~juhtolv/configs/shellrc/i

    --
    Juhapekka "naula" Tolvanen - http://iki.fi/juhtolv
  47. Re:if your prompt looks like.... by jbarr · · Score: 1

    Or if your prompt is:

    $

    You spent way too much time learning VAX DCL and no one respects you for it!

    --
    My mom always said, "Jim, you're 1 in a million." Given the current population, there are 7000 of me. God help us all!
  48. Unix -> DOS by Timothy+Chu · · Score: 1

    When I first started using XWindows (being from the Windows world), I put up a screenshot of my windows desktop as the background, and set my commmand prompt to be "c:\", just to make me feel more at home.

    <tim><

    1. Re:Unix -> DOS by mr3038 · · Score: 1
      It's XWindow, NOT XWindows

      $man X
      ...
      The X Consortium requests that the following names be used when referring to this software:

      X
      X Window System
      X Version 11
      Window System, Version 11
      X11

      X Window System is a trademark of X Consortium, Inc.
      ...

      I don't see XWindow there... If you want to whine get your facts right.
      _________________________

      --
      _________________________
      Spelling and grammar mistakes left as an exercise for the reader.
  49. This has simply got to be... by talks_to_birds · · Score: 1
    ...the most interesting goddang article I've seen here in *what?*

    Years?

    Ever?

    Can't wait to get home and tinker!

    t_t_b
    --
    I think not; therefore I ain't®

    --
    I'm on PJ's "enemies" list! Are you?
  50. Re:Anyone seen this article at IBM? by talks_to_birds · · Score: 1
    if yer cuttin' an' pastin' watch out for the space between "r" and "y" in "library"

    it generates a 404...

    t_t_b
    --
    I think not; therefore I ain't®

    --
    I'm on PJ's "enemies" list! Are you?
  51. useful prompt by copycat · · Score: 1

    besides being pretty and colorful this prompt is useful as well!

    set prompt="%{\033[0;35m%}<%{\033[30;1m%}%h%{\033[0 ;35m%}>%{\033[0;36m%}%m%{\033[1m%}: %{\033[32m%}%c5%{\033[33m%}%#%{\033[0m%} "
    set rprompt='%S%$note %s [%B%?%b] %D %w %T'

    (make sure there are NO spaces in the $prompt variable. even though the above shows a space after a [0)

    from right to left:
    * history number.
    allows you to quickly recall history events you see on screen.

    * machine_name:path.
    useful if you use rcp or scp, simply copy-paste the relevant part of the prompt to another window:
    > scp a.out carl:~/R+D
    i used to have my login name there too:
    <212>eli7@fuzzy:~/R+D>
    which helps if you have different logins on different machines.
    <501>ealexand@dubek:~/ckp> scp tmp.c eli7@fuzzy:~/R+D
    but the prompt becomes a bit too long.

    * a little reminder.
    i have a silly alias for taking a small note:
    alias note 'set note="\!*"'
    if i type "note call home" this will show up on the right hand side of my screen as a reminder.

    * exit status.
    cant live without it! for those programs that dont bother printing error messages for us humans.

    * and finally the date and time.

    Try it!

    p.s.
    if i dont have a color terminal i use:
    set prompt="<%h>%m:%c5%# "
    or with some c-shells:
    set prompt="$hostname> "

  52. Re:DOS Format C? by Bake · · Score: 1

    I think it's included in the XScreensaver package by Jamie Zawinski (of Netscape fame).

  53. mini-canadian flag by ger · · Score: 1
    I have a mini canadian flag in my prompt, using an asterisk for the maple leaf.

    Here's a screenshot, and here's the .bashrc stuff used to do it.

  54. Whatever title to pass antilameness: Another by Pseudonymus+Bosch · · Score: 2

    1. C:\>

    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.
    __

    --
    __
    Men with no respect for life must never be allowed to control the ultimate instruments of death.
    GW Bu
  55. my boring prompt by Kazin · · Score: 1


    Mine is just:

    export PS1='\u@\h:\w\$ '

    If I'm root I just s/\\\$/#/ instead.
    Plain, boring, but highly informative.

    Also in my .bashrc:

    if [ "$TERM" = "xterm" -o \
    "$TERM" = "xterm-color" -o \
    "$TERM" = "rxvt" -o \
    "$TERM" = "vs100" ]; then
    export HOST=`hostname`;
    export PROMPT_COMMAND='echo -ne \
    "\033]2;$HOST: $PWD\007\033]1;$LOGNAME@$HOST\007"'
    fi

    - Kazin

  56. I'm disgusted by glitch · · Score: 1

    "show-me-yours and I'll-show-you-mine"?! What kind of self-absorbed phallic wars are we engaging in here? Personally, I'm beyond a little disappointed that such a supposedly enlightened "geek" culture as Slashdot's could be so preoccupied with something that is nothing more than glorified penis worship. You should all be ashamed of yourselves.

    Anyway, here's mine:

    PS1="[c=====================8 \W]\\$"

  57. A prompt to help prevent stupidity by Hacksaw · · Score: 1

    In .profile, using bash:

    PROMPT_COMMAND='PS1="[\t]-------->\n\h:\w\n\u > "'
    if test `id -u` = "0"
    then PROMPT_COMMAND='PS1="[\t]\n\h:\w\n\033[31;5mROOT\0 33[0m> "'
    fi

    Simply, a normal prompt looks like this:

    [12:40:03]-------->
    habitrail:/home/httpd/html/hacksaw
    hacksaw >

    But if I am su'ed to root, it looks like this:

    [12:41:00]
    habitrail:/home/httpd/html/hacksaw
    ROOT>

    Where the word ROOT is in red.

    The root account has its own standard prompt, which I left alone to remind me when I am using root's environment instead of my own, with its different paths and aliases.

    And, of course, I use sudo as much as possible.

    --

    All the technology in the world won't hide your lack of vision, talent, or understanding.

  58. my prompts in dos and unix are almost the same by Frederic54 · · Score: 1

    in 4DOS box under windows (need ansi.sys)

    prompt `[$n:%@label[$n]] $e[7m%_cwp $e[0m$h %% `

    in BeOS:

    PS1="[\h] \[\e[7m\w\[\e[0m \! % "
    --

    --
    "Science will win because it works." - Stephen Hawking
  59. Re:Use a real shell! by gr · · Score: 1

    Heh. And I was just about to make a "Feh, bash" post.

    I like using zsh's RPROMPT, though the results don't show up in html /. posts very well.

    (I keep RPROMPT set to '[%!]'.)

    --

    --
    Do you have a /. uid shorter than five digits? No? Then piss off.
  60. Re:zsh prompt... by gr · · Score: 1

    Strikes me as just a touch redundant, no?

    (I mean, do you really need both %m and %M both in PS1, and both %d on the left and %~ on the right?)

    --

    --
    Do you have a /. uid shorter than five digits? No? Then piss off.
  61. zsh prompt & xterm codes by nowan · · Score: 2

    Mine is fairly simple, but I like it. (I wonder if this will make it past the lameness filter.)

    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.

  62. .prompt by alien · · Score: 1

    #Kewl funky looking prompt stuff
    GRAD0='\[\033[00m\]'
    GRAD1='\[\333\262\261\260\]'
    GRAD2='\[\260\261\262\333\]'
    COLOR1='\[\033[01;32;46m\]'
    COLOR2='\[\033[00;30;46m\]'
    COLOR3='\[\033[00;34;46m\]'
    COLOR4='\[\033[00;34m\]'
    COLOR5='\[\033[00;32m\]'
    COLOR6='\[\033[01;37m\]'
    COLOR7='\[\033[01;32m\]'
    COLOR8='\[\033[00;37m\]'
    PS1=$COLOR3$GRAD1$COLOR2'\h'$COLOR3$GRAD2$COLOR4 \
    $COLOR6' \d '$COLOR5'-'$COLOR6' \t'$NONE'\n'$COLOR5'\u'$COLOR8':'$COLOR7'\w'$COLPS 2=$COLOR1$GRAD1$COLOR3$GRAD2$COLOR4$GRAD1$COLOR5'> ' $GRAD0' '

  63. zsh prompt... by kevin+lyda · · Score: 2
    note the ^[ bits are escapes. C-v ESC in vi.

    if [[ $OSTYPE == solaris2 || $OSTYPE == osf4.0 ]]; then
    PS1='%n@%m(%(t.Ding.%@))%# '
    else
    PS1='%n@%m(%(t.Ding.%D{%l:%M%P}))%# '
    fi
    RPS1="%B%{^[[35m%}[%20<..<%~]%{^[[30m%}%b"
    export PS1 RPS1
    --
    US Citizen living abroad? Register to vote!
    1. Re:zsh prompt... by Martin+Maciaszek · · Score: 1

      Speaking of zsh. Here's mine: (no colors, just pure geeky style)

      PS1='%n@%m[%!]:%~%(!.#.$) '

      This expands to something like:

      fastjack@nexus[314]:~$

      The first number is the return code of the last command and the second is the line number of the history.

      Now just turn on CSHJUNKIEHISTORY and work effectively :)

    2. Re:zsh prompt... by Carl+Drougge · · Score: 1
      Well, I have to attach myself to some thread, and it might as well be this one.. Ok, here are my zsh-prompts for home-machines:

      PROMPT=$'%{\e[m%}%n%{\e[33m%}@%{\e[m%}%m%{\e[31m%} %# %{\e[m%}'
      RPROMPT=$'%{\e[31m%}%#%{\e[m%}%3~ %T %0(?:%{\e[32m%}:%{\e[31m%})[%?]%{\e[m%}'

      This expands to something like this:

      marvin@towel% <write stuff here> %~ 0:36 [0]

      Both % are # if I'm root, the [0] is the return code of the last command, green if 0, red otherwise. Pretty long prompts for such little effect.. =)
      (Oh yeah, the ~ is of course current directory, never showing more than 3 levels.)

  64. Re:Blue Screen of Death (in DOS) by Glytch · · Score: 1

    Maybe that's what I miss most about MSDOS. It was crippled and badly designed and basically useless, but I never, ever saw it crash.

  65. [start] by _14k4 · · Score: 1

    [start][run] :)

  66. zsh prompts by Rain · · Score: 1
    I figured I'd throw together my zsh prompts for consumption by the masses. Since /.'s comment code would undoubtedly devour it with great prejudice, I'll throw you here instead--there's an html and a png sample as well as the relevant chunk from my zshrc.

    All of these prompts have a lot of (what some would call superflous) information in them--I usually use prompt1, and I use all of the information it provides me on a regular basis. zsh's RPROMPT feature (which allows you to have part of the prompt tacked onto the right side of the terminal) is especially handy here, as it makes everything feel less cluttered. (There's no way in hell I'd have all that information otherwise--I'd be rather annoyed to have half of my screen real-estate gobbled up mercilessly by my prompt.)

    I'm of the opinion that those who complain about prompts with lots of information are

    • masochists (no, I LIKE having to whip out 3 or 4 commands every time I want to know some information I use on a regular basis!)
    • lazy/inexperienced (Yeah, I could do that, but I lack the ambition/knowledge to do that and I'm jealous)
    • several times my age (back in MY day, we didn't have any of these newfangled monitor things--hell, my tractor only had one prompt, and that was for gas!



    Just my .02 (since I like complaining :)
    --
    Ben Winslow..........rain@bluecherry.net
    bluecherry internet..http://www.bluecherry.net/
  67. Re:Root prompt by gid · · Score: 1

    looking at this closely, those are backticks, which means that's shell code, I wouldn't run that if I were you, especially as root. I'm much to lazy to figure out what it does.

    ---

  68. Re:Mine does xterm titles! by lgm · · Score: 1

    While I see we have the same taste in prompts, I go about it a little different, plus I throw in a few colors for easy recognition.

    xterm|xterm-*)
    export PS1='\[\033]0;\u@\h:\w\007\[\033[32m\]\u\[\033[0m\ ]@\[\033[31m\]\h\[\033[0m\]:\[\033[33m\w\[\033[0m\ ]\$ '
    ;;

    --
    -- "it's not enough to be a great programmer; you have to find a great problem" - Charles Simonyi
  69. Admin's minimalist prompt by larien · · Score: 2
    As an admin, I need, mainly, two bits of information: who I'm logged in as and where. I just use something like PS1="%n:%m%# " (zsh syntax) which gives a login like jr:larien% or root:box# It means I can tell at a glance which system I'm logged into and as who, so I don't do something stupid as root (well, I'm less likely to!).

    For those not using zsh, you can use something like PS1="`whoami`:`hostname`% ".
    --

  70. .profile? Nyet. Use zsh. by pschmied · · Score: 1
    From my .zshrc--short and sweet:

    setopt AUTO_LIST AUTO_MENU
    PROMPT='%m}%~> '

    Give zsh a shot. It really is pretty cool.


    -Peter

  71. Looking for a Texas Flag prompt by cjsnell · · Score: 2

    Back in the day, I had this leet-o prompt on my DOS box that was a little Texas flag made from an asterisk and a little high-ascii block. I wonder, first off, if any *nix terminal emulators will support all of those old ANSI drawing characters and if anyone still has this prompt lying around.

    BTW, remember ANSI bombs? heehee


    --

    1. Re: Looking for a Texas Flag prompt by jarehart · · Score: 1

      I didn't have problems/fun with ANSI bombs, though I remember how much nicer ANSI art was when I moved from a 2400bps modem to a 14.4kbps one. :)

      And I do remember Texas flag DOS prompt. I know I still have it laying around on a DOS box at my dad's house, but I can't quite remember the ANSI escape sequences to generate it. Ahh, Google came to the rescue with this page.

  72. Mindless fun by Francis · · Score: 1

    You know? I thought it was only select crazy idiots like me who spent hours mindlessly customizing the perfect prompt..

    Here's the fire-looking prompt that was so popular a coupla years ago. (requires ANSI fonts)

    fp ()
    {
    PS1='\[\033[01;33;43m\]\333\262\261\260\[\033[01;3 7;43m\] \u[\!]\[\033[00;31;43m\]\260\261\262\333\[\033[00; 31;40m\]\333\262\261\260\[\033[m\]'
    }

    But now, I have something a little more "proffessional". The idea is to have your root and user prompts look really different, and have the path in the title bar. Also, high legibility when backscrolling.
    The extra stuff is to show your shell depth. (How many subshells you have) This is mostly to make figuring out which terms have screen running on them.

    SHELL_DEPTH=$(expr $SHLVL \- 0)
    export SHELL_DEPTH

    # The Standard prompt (blue for users, green for root)
    if [ $HOME = '/root' -o /$USER = '/root/' ]
    then
    PS1='\[\033[34;42m\]\u@\h[\!]\[\033[00;31;42m\]\$\ [\033[m\] '
    else
    PS1='\[\033[34;46m\]\u@\h[\!]\$\[\033[m\] '
    fi

    PS2="++>"

    # Prepend a shell level "sticker" to indicate a screen session/subshell
    # (Less to compensate 1 for X-window local connections)
    MY_SHELL_DEPTH=`expr $SHELL_DEPTH - 1`
    if [ $MY_SHELL_DEPTH -gt 0 ]
    then
    PS1='\[\033[31;46m\]'${MY_SHELL_DEPTH}'>'${PS1}
    fi

    # PROMPT_COMMAND="echo '(wd: ' \$PWD')'"
    PS1='\[\033]0;\u@\h: \w\007\]'${PS1}


    --
    #include <malloc.h>

    --

    --
    #include <malloc.h>
    free(your.mind);
  73. Mine by Ed+Avis · · Score: 2

    You should read the Bash-Prompt HOWTO for more
    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 /usr $

    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 .bashrc.

    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.

    --
    -- Ed Avis ed@membled.com
  74. My prompt by Coverfire · · Score: 1

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

  75. I use... by Doctor+Memory · · Score: 1

    PS1=" ::= "

    --
    Just junk food for thought...
  76. Just like the good old days by rpete · · Score: 1

    export PS1='C:`pwd | sed s/\\\\\//\\\\\\\\\\\\\/g | tr a-z A-Z`> '

  77. another one for tcsh by MaufTarkie · · Score: 1

    I've been using this for years. Does everything I need it to w/o being too much clutter:

    My .tcshrc has:

    setenv WHOAMI `whoami`
    set prompt="CWD: %B%~%b\n%m{${WHOAMI}:%l}:\!%% "

    which produces:

    CWD: ~
    segfault{mauftarkie:ttyp2}:13%

    I don't expect anyone to read this, but I figured I'd at least post for posterity. Maybe someone will find it useful.

    --
    Without you I'm one step closer to happiness without violence.
  78. (user) host:workingdir$ by Mr+Z · · Score: 1

    If I'm on a plain VT100:

    • PS1="(\u) \h:\w\\$ "

    If I'm in an XTERM window, I like to have some info in the title bar:

    • PS1='\[\033]2;(\u) \h: \w^G\](\u) \h:\w\$ '

    That ^G is a Control-G (ASCII BEL). This is part of the escape sequence XTERM uses for setting its title bar. I suppose I could've used \007. Ah well.

    --Joe
    --
  79. Modified Mandrake by Vapor · · Score: 1

    Mandrake (of enlightenement and other fame) has/had his prompt on his site (mandrake.net) and I took it and modified it to my liking. Here it is.

    TERMIMON=`tty|cut -d/ -f3`
    COLOR1="\[\033[1;36m\]"
    COLOR2="\[\033[1;34m\]"
    COLOR3="\[\033[1;33m\]"
    COLOR4="\[\033[0m\]"
    export PS1="$COLOR3<DA>$COLOR3<C4>$COLOR2[$CO LOR1\u$COLOR3@$COLOR 1\h$COLOR2]$COLOR3<C4>$COLOR2[$COLOR1$TERMIM ON$COLOR2] $COLOR3<C4>$COLOR2[$COLOR1\$(date +%I:%M%P)$COLOR3:$COLOR1\$(date +%m/%d
    /%y)$COLOR2]$COLOR3<C4>$COLOR3<C4>$COL OR4\n$COLOR3<C0>$COLOR3<C4>$ COLOR2[$COLOR1\w$COLOR2]$COLOR3>$COLOR4 "

    This shows user@host, current tty your on, time, and date on first line. Second line shows pwd. And its in shiney pretty colors! I have a different color scheme for users than for root. This one is for users. I don't thing any of the characters got munged by the html-ification of it. Looks like there are some extra spaces that get added for some reason. Anyway, there it is.

  80. My bland Prompt by Doctor_D · · Score: 1
    My prompt is quite simple...but on the sheer number of machines I have an account on or root on, it works fairly well.

    PS1="`hostname`:$LOGNAME:# "
    -- # for root, $ for user.

    Pretty basic, but then I'm more for minimalistic sorts of things. For example I don't use GNOME, KDE or CDE, but I like FVWM or Enlightenment.

    --
    "If you insist on using Windoze you're on your own."

    --
    "If you insist on using Windoze you're on your own."
  81. Re:Real geeks don't need fancy command prompts. by mellon · · Score: 1
    Mostly because I'm too busy hacking to custom tweak my machine. The last custom tweak I did was, with the help of kind person from Russia, to get emacs to display Tibetan characters. This is something I actually need, believe it or not.

    I don't mean this critically - I would actually really like to put some eye candy on my display. I just don't have time. Hacking prompts doesn't benefit me, so I don't do it. Adding eye candy might benefit me, but there are so many ways to do it that I just haven't spent the time to choose one yet, and TBH I don't know when I'll get a chance. :'}

    Seriously, next time you spend an afternoon tweaking your computer to look cool, think for a minute about how much useful documentation you could have added to your favorite open source project, or the feature you could have hacked, or whatever, instead. You've got to chill sometimes, and environment hacking is one way to do it, but it can be a vice if you do it too much.

  82. Real geeks don't need fancy command prompts. by mellon · · Score: 2
    We remember where we are. The ultimate uebergeek command prompt is "# ". Uebergeeks also don't need fancy tty modes that display the characters we delete - we use "#" as a delete character.

    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. :')

    1. Re:Real geeks don't need fancy command prompts. by VFVTHUNTER · · Score: 1
      yeah, and screw that X-Windows crap. REAL GEEKS use only the terminal, and when we must, we hard-code GUI apps in SVGAlib.

      What planet are you on? The *point* of free software is that you can modify it (so it looks cool). Eye-candy is just one of the many perks. So if you are using OSS, why are you still pretending you're on a closed-source DOS machine?

    2. Re:Real geeks don't need fancy command prompts. by dghcasp · · Score: 1
      PS1="Z="`hostname`"; " ; PS2="; "

      Tells me the hostname (which is all you need to know) and has the advantage that I can include the prompt in cut&paste command lines with 3-clicks in Xterm and they will still run.

      Try that with your PS1="IMSOELEET\033[c" prompts! :)

  83. prompts in zsh by Tharsis · · Score: 1

    does anyone know how to do a 2 line prompt in zsh?

    1. Re:prompts in zsh by opk · · Score: 1
      By sticking a newline in the middle of it where you want to break to the second line.

      My zsh prompt is something like this:
      PS1="%{$pcolr%}$user$host%~%"'$((COLUMNS-12))'"(l. $prompt_newline. )[%h%0(?..:%?)]%# %{$tcolr%}"

      This puts a newline in only if it is getting close to the right edge of the terminal. I configure different colours depending on the host and the user and host variables are only set for when I'm logged on to something different to normal. At the end, it includes the current history number and the return code of the last command if it was non-zero. Most of the time, it looks fairly minimal though - something like ~ [100]%

      If you have a recent zsh, this is one of the examples for the prompt themes - do:
      autoload -U promptinit
      prompt oliver
      to see it.

  84. bash prompt with colored hostname by kampi · · Score: 1

    Living in several networks I like to have intuitive signal where I am by first making the hostname standout (colored) and second using different colors in different networks.

    This is one of them
    \[\033]0;\h:\w\007\]\u@\[\033[1;34m\]\h\[\033[0m\] :\W>

    --
    -- a blessed +42 regexp of confusion (weapon in hand) You hit. The format string crumbles and turns to dust
  85. scp syntax= user@box:path by Danny+Rathjens · · Score: 1

    for tcsh:
    set prompt=' %n@%U%m%u:%/%% '

    This way you can easily cut and paste into an scp command.

    Also, I use underline for the machine name so that it stands out to mor easily see which machine you are on. I also set underlined chars to show up as yellow in my color xterms(black bg, cyan text).
    --

  86. Re:Blue Screen of Death (in DOS) by HP+LoveJet · · Score: 1

    > Consider yourself lucky, it was easy enough to generate a general protection fault.

    In DOS? Um, with all due respect, no.

    DOS didn't take advantage of any of the facilities that the 80286 and later processors provided for multiuser operating systems. There was no concept of rings, or of kernel code having a greater privilege level than user code. So you'd never get anything as helpful as a GPF or SEGV.

    It was incredibly easy to get DOS to crash, but that was something that usually happened as a result of some errant user program scribbling on the global interrupt vector starting at 0000:0000, which would generally just leave you completely hosed until you did a hard reset. Ah, DOS. How I don't miss you.

    --
    spawn_of_yog_sothoth
  87. Bash Bashing: Bash is out. Zsh is in. by alpha · · Score: 1

    For years i've continued to be amazed by the fact that people are still using bash, when zsh is backwards compatible, and superior in every way.

    Beware: Everybody who tries zsh will never use another shell again, and will be angry whenever they have to work on a machine that doesn't have zsh installed. Unfortunentely its default tab completion settings are not very good, so you need the options i present here.

    It's tab-completion control and configurability is unparalleled. It can even be set to either bash or c-shell junkie mode to emulate your favorire shell before you see the light.

    Try putting this in /etc/zshrc (remove old junk RedHat keep there, or just add this)

    # tune the tab completion and other options.
    # yes you can tab-complete "setopt", and see all the options!
    setopt autolist autoremoveslash correct nohup nobeep extendedglob appendhistory \
    listtypes histignoredups hashcmds hashlistall histnostore histignorespace

    # and remember your history between logins
    HISTSIZE=5000
    SAVEHIST=100000
    HISTFILE=$HOME/.zshhist

    # show user@host:/path in xterm title bar
    # maybe you want an if [[ $TERM != linux ]]; wrapped around this.
    precmd() { print -n "\033]0;Terminal: $USER@$HOST:$PWD\007" }

  88. Re:WARNING: read this first before you cut'n'paste by Ethan · · Score: 1
    Uhh, the exit would exit the command shell and it would cease to be harmful at that point. :-)

    You can't affect a parent shell from a subshell in any way that I am aware of.

  89. Re:Counterexample by Ethan · · Score: 1

    I guess my statement was too wide-reaching. ;-) I meant that you can't execute commands/change environment variables/etc. i.e. you can't do damage in a parent shell from a child su nobody'd shell. Sure you can kill it, but you can't 'rm -rf /'.

  90. colored prompts by magister · · Score: 1

    I have to have colored prompts. I use them to designate what disto that computer is running or what that computer is used for. I use 2 diffrent ones for now. One for my slackware boxes and the other one for my debian boxes.

    Since I wanted to test making prompts quickly I put them in seprate files and date them. Then I symlink that file to /etc/prompt. My .profile simply has:

    PS1=`cat /etc/prompt`

    I use extended ASCII so these may not come through correctly, but here is my slackware prompt:

    \[\033[00;34m\]ÚÄ\[\033[01;34m\]®\[\033[00;36m\][\ [\033[01;35m\]\d\
    \[\033[00;36m\]]\[\033[01;36m\]ð\[\033[00;36m\][ \[ \033[01;31m\]\t\
    \[\033[00;36m\]]\[\033[01;36m\])\[\033[01;34m\]- \[ \033[00;34m\]=:\
    \[\033[01;37m\]ù\n\[\033[00;34m\]ÀÄ\[\033[01;34m \] \[\033[00;34m\]\[\033[00;37m\]

    and my debian prompt:

    \[\033[00;35m\]ÕÍ\[\033[01;35m\](\[\033[00;36m\]\d \[\033[01;35m\]>\[\033[01;35m\]:\
    \[\033[00;35m\])\[\033[00;37m\]


    Also since the 2.2.x kernels the extended ASCII dosen't show up correctly. Though if I run bitchx and quit then that terminal shows correctly. Does anyone know how to make this work at boot time?

    --
    -magister-
  91. Simple, but useful by TDO · · Score: 1

    I enjoy the likes of zsh, and use RPS1 for a prompt on the right side of the screen:
    PS1="%B%t%b-%m%# "
    RPS1=" %h:%B%c%b"


    ---

    --

    ---
    "To know recursion, you must first know recursion."
  92. Re:WARNING: read this first before you cut'n'paste by PD · · Score: 1

    What's going to stop someone from just putting "exit" into the commands run, thereby hosing your system?

    Don't follow his advice. If you must try every prompt here, I recommend gettng VMWare or using a machine that you were going to completely wipe later today anyway.

  93. my tcsh prompt by prijks · · Score: 1

    set prompt="[%P] %B%n@%M%b:%l [%~] (%?)\nprompt-fu =%# "

    yes, I did waste some time reading the tcsh man page. yes, it was worth it.

    1. Re:My tcsh prompt by gmccon · · Score: 1

      wow, i really screwed that up.

      gg, html.

      admin01[/home/mcconngl](4)
      root@admin01[/root](5)

      the prompt will only show down to two directories in the prompt (the two most recent) and will show a number showing shell lvl if you go deeper in shells

      id | grep -s 'uid=0(' > /dev/null
      if ( $status == 0 ) then
      set prompt = "%Broot%b@%m[%C2](\!) "
      else
      [ $SHLVL -ge 2 ]
      if ( $status == 0 ) then
      set prompt = "%m[%C3]%B|$SHLVL|%b(\!) "
      else
      set prompt = "%m[%C3](\!) "
      endif
      endif

  94. Re:Woo hoo! Another C shell user! by prijks · · Score: 1

    > For root, substitute final > with #

    actually, just use %# instead, tcsh will replace it with a # if the user is root, and with > otherwise. cuz tcsh rocks like that.

  95. my zsh prompt... by orabidoo · · Score: 2
    ... puts the window name (from an env variable set at .xinitrc time), the machine name and the current dir at the window title, and prints a plain '$ ' as the prompt, or '# ' if i'm root. it also clears any bold mode or color, in case the previous program forgot to do so.

    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.

  96. And more prompts by looie · · Score: 1
    My user shell is tcsh:

    alias setprompt 'set prompt="(`uname -sr`)[$cwd] %t\\
    {\!} --> "'
    alias cd 'chdir \!* ; setprompt'

    setprompt

    And my root shell is bash:

    PS1="(`uname -sr`) [\u] [ \w] \n \! \$ --> "

    mp

    --
    "The secret to strong security: less reliance on secrets." -- Whitfield Diffie
  97. echo \"$PS1\" by Pig+Hogger · · Score: 2
    "\u@\h \w\$ "

    --

  98. Bah, we don't need no steenkin' BASH here! by greydmiyu · · Score: 1

    ZSH, baybe!!!

    PROMPT='%(!..{)%n@%m':'%~%(!.#.}) '

    --
    -- Grey d'Miyu, not just another pretty color.
  99. Mine does xterm titles! by sab39 · · Score: 2

    This puts my username, host and working directory in both my prompt and my xterm window title. Put it in /etc/profile on all machines you use and you always know where you are :) Only works if your shell is bash, though.

    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

  100. Might as well join in... by Drakino · · Score: 2

    PS1=$'\\[\\033[1;34m\\]\\h\\[\\033[31m\\] = = = - - -\\n\\[\\033[0m\\]\\!:\\u:\\w>'

    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.

  101. Re:Prompness... by BJH · · Score: 2

    You do know that if you're using bash, you can get the hostname up to the first . with \h, don't you?

  102. Command prompt? by grub · · 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

    --
    Trolling is a art,
  103. Re:WARNING: read this first before you cut'n'paste by esper · · Score: 2

    Keep in mind that reusing the same dummy account all over the place may undermine the inherent security and other benefits of using that user. Each service should have its own dummy user (typically named after the service) so that cracking one service doesn't allow the intruder to affect other services. (Historical note: 'nobody' and 'nogroup' were created specifically to handle unrecognized uids/gids encountered by NFS-using systems. They were never intended to actually own any files or processes.)

  104. Chroot jail by Sangui5 · · 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).

  105. blame raster for this one by ShinGouki · · Score: 1

    yes, i'm an E fanatic and all the time spent staring at raster's screenshots must have warped my mind, so i blame him ;)

    here's my prompt:

    PS1="\[\e[1;34m\]\332\304\304|\T|\304\304\277\n\ 30 0\304\304|hi \u|\304\304\331 \w \$ \[\e[1;37m\]"

    btw, for a good ansi font, try smoothansi ('s what i'm using) and a nice tutorial on how to begin building incredibly interesting and not all that useful prompts, check out keebler's page on it:

    http://knuckle.sandwich.net/ansi.html


    -dk

    --
    -dk
    Dream with the feathers of angels stuffed beneath your head.
  106. Cut/Paste-proof prompt by Bloody+Peasant · · Score: 1
    Ever accidentally paste a bunch of crap into your {x|k|gnome}term when you really didn't mean to? Heh. Sure you didn't. Riiiight.

    Anyway, I picked this up from a colleague in CHUUG:

    export PS1=": \h_\u; "

    (the spaces are important). The handy thing about this (assuming you're a bash/ksh/zsh/ash/sh user) is that ":" is the proverbial "ignore me" command, and y'all know what the semicolon does. So this way, you can cut and paste whole lines without worrying about any crap^H^H^H^Hcute metacharacters in your prompt getting in the way and creating all sorts of useless crud (for those who use angle brackets).

    --
    -- This .sig intentionally left meaningless.
  107. Custom Console Fonts without X-Font Server by Elik · · Score: 1

    There was a feature that Slackware had which you can setup your own weird fonts in the console prompt or by SSH.

    I been trying to figure out which one it is that I can grab and install so that I have fun with it. I was fun with the lazy fonts that I messed with years ago.

    --
    -- Amazing how the Internet still humms along.... -- Dispite all the flaws of Micro$oft in their software!
  108. Just put the user@hostname in the promt by erice · · Score: 1

    Simple, really. And, unlike using colored windows, the prompt actually stays correct whenever you ssh from one machine to another.

    I also put the hostname in the window titlebar. 'Useful for finding the apropriate window when it is iconified. I haven't figured out how to make the title bar actually track the hostname though.

  109. Re:How about this by ScottDWebster · · Score: 1

    If you change "alias l.='ls .[a-zA-Z]* --color=tty'" to "alias l.='ls .[0-z]* --color=tty'" it will be a little more usefull.

  110. Re:KSH Prompt? by Quickening · · Score: 1

    the trick is to escape shell processing when defining PS1:

    PS1=`hostname`':$PWD$ '

    gives:
    genesis:/usr/local$ _

    --
    tcboo
  111. Current (relative) directory by Force · · Score: 1
    Here's what I use, since I like to know where I am, and I like a shortish prompt:
    PS1='${PWD##$PREFIX}$ '
    PREFIX=*/

    This shows me the basename of my current directory. Another good setting is PREFIX=$HOME/, which displays my current working directory as a relative path to home (if I'm under it), otherwise the complete pathname. Note that $PREFIX is a glob pattern, not a regular expression.

    I don't use VT100-style colour changes in my prompts, because they don't play well (for example) within an Emacs shell buffer.

  112. Moderation - can we have some actual examples? by TRS-80 · · Score: 1
    All the comments at +5 are just comments on shell prompts, there are no actual shell prompts. Someone should test them all out and moderate according.

    Thanks (does slash 2.x support editorial comments like scoop?)

  113. Finally something useful by R3 · · Score: 1

    This is by far the best AskSlashdot topic in recent memory (that goes all the way back to March, in my case...:)

  114. Here's mine... by Teferi · · Score: 2

    PS1='[\h:\w] \u$ '
    (Yes, it's the same as in OS X. I just happen to like it.)

    --
    -- Veni, vidi, dormivi
    1. Re:Here's mine... by Eil · · Score: 2


      On the topic of \$, I've recently run into something strange...

      For some reason, for Bash on Linux, I have to use \\$ to have the $ change to a # for the root user. Otherwise, I get $ even at the root prompt.

      But for Bash on FreeBSD, I have to use \$ or else I get the same situation as above. Wackyness. My prompts on both systems are identical otherwise.

  115. Default by Abattoir · · Score: 1

    i dont have time to mess around with changing silly command prompts. no matter what the OS, it's the default.

  116. colorful and functional .bash_login.... by Gaewyn+L+Knight · · Score: 1

    function fire
    {
    local COLOR_RED='\[\033[00;31;40m\]'
    local GRAD0='\[\033[00m\]'
    PS1="$COLOR_RED\h$GRAD0 "
    }
    function green
    {
    local COLOR_GREEN='\[\033[0m\033[32;40m\]'
    local GRAD0='\[\033[00m\]'
    PS1="$COLOR_GREEN\h$GRAD0 "
    }

    if [ $UID == '0' ] ; then
    fire
    else
    green
    fi

    Simple... but it keeps me from destroying stuff as root and not knowing it...

    --
    Telcos have alot of dark fibre in the States. Most people assume that's optical fibre...but it's actually moral fibre.
  117. My Prompt, Boring But Effective. by Bowie+J.+Poag · · Score: 1


    PS1="[\h][\w] : "

    In longhand, it shows [Hostname][Fully Expanded Path] username :

    --
    Bowie J. Poag

  118. Evil things to do in a shell prompt: by Bowie+J.+Poag · · Score: 1



    If you're looking for a unique way to crash the almighty pound bang slash bin slash bash, try this on:

    PS1=`cat /proc/kcore`

    Whammo. No more xterm.

    Then again, a 256MB-long shell prompt may not be such a good idea, but its a bug nonetheless.

    --
    Bowie J. Poag

    1. Re:Evil things to do in a shell prompt: by binford2k · · Score: 1

      Not a bug. It's enough rope to shoot yourself in the foot with!

    2. Re:Evil things to do in a shell prompt: by ichimunki · · Score: 1

      Cool... never thought to set the prompt (or even part of it) to the output of backticks.

      --
      I do not have a signature
  119. Re:Yours looks EASY by The+Evil+Dwarf+from · · Score: 1

    I can relate, having typed reboot on a core server thinking I was in a development server (on a real time stock quotation system...) you can imagine my chagrin.

    We are the mutts...

    but not bell boys.

  120. Bright colors thanks to `dotfile`! by ivan256 · · Score: 2

    PS1=$'\\[\\033[34m\\][\\[\\033[1;37m\\]\\@\\[\\033 [34m\\]]\\[\\033[32m\\]\\u\\[\\033[1;37m\\]@\\[\\0 33[31m\\]\\h\\[\\033[1;37m\\]:\\w\\[\\033[34m\\]>\ \ [\\033[0m\\]'

    I wonder if they disabled the lameness filter for this story...

  121. xterms are out friends by FunnyBunny · · Score: 2

    set prompt="%{\033]0;%n@%m:%~\007%}"

    This puts the info for the current user@host:directory in the title bar.

  122. Built for comfort, not flash by arensb · · Score: 1

    if ( $?term && "$shell" =~ *tcsh) then
    if ( "$term" =~ xterm* ) alias cwdcmd 'echo -n "^[]2;${HOST} - ${cwd}^G"'
    endif

    set hostname=`echo $HOSTNAME | sed "s/\..*//"`
    set euser=`whoami`
    if ( "$euser" == arensb ) then
    if ( "$shell" =~ *tcsh ) then
    set prompt = "%U[\!]$hostname >%u "
    else
    set prompt = "[\!]$hostname > "
    endif
    else
    if ( "$shell" =~ *tcsh ) then
    set prompt = "%S[\!]$hostname($euser)>%s "
    else
    set prompt = "[\!]$hostname($euser)> "
    endif
    endif

    -----

    No, this isn't flashy. But if I'm su-ed to someone
    else, the prompt is in inverse video rather than
    underlined.

    The hostname and current directory go in the
    xterm title bar, rather than cluttering up the
    prompt.

  123. I've been using this one in tcsh for ten years. by Rewd · · Score: 1

    This is very handy to remind yourself who
    and where you are at all times.

    if ( $?prompt ) then
    set prompt="%B%S%m%s:`whoami`%b \!> "
    endif



    --

  124. Need more colors! by Mike+Schiraldi · · Score: 2
    It's times like this that i ask myself, why are we limited to just the ANSI colors in our xterms?

    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?

    --

    1. Re:Need more colors! by J'raxis · · Score: 1

      That would definitely be a good idea. Then we could have full-colour ASCII art in our MOTDs, too. ;)

  125. Re:Yours looks EASY by Mike+Schiraldi · · Score: 2
    Yeah, but then you have this problem.

    BTW, i have a neat case .. esac statement to set the color and then a PROMPT_COMMAND to check the result of the last command you typed, and print out the result code, unless it's been printed before (i.e. if you type "ls asdfasdf" and then hit enter three times, it only prints it once)

    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) $
    [~]$
    [~]$

    --

  126. Re:WARNING: read this first before you cut'n'paste by Surak · · Score: 5

    Set a password on the nobody account and give it a shell... so you can log in.

    passwd nobody
    chsh nobody /bin/sh

    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.

  127. Amen. by FatSean · · Score: 1

    [eom]

    --
    Blar.
  128. 2 line green to white by ripler · · Score: 2

    set prompt="%{^[[1;32;40m%}%t-%n@%m\n%/%{^[[0;37;40m%} > "

  129. Re:Yours looks EASY by Black+Parrot · · Score: 1

    > Use color !

    Most of DEC's black-and-white VT terminals supported some kind of character-graphics display, where each "letter" was drawn as a little line or box or circle (etc) when you escaped into graphics mode. So people would use escape their prompt definitions and use strings that would result in images for their prompts.


    --

    --
    Sheesh, evil *and* a jerk. -- Jade
  130. Simple & functional. by Black+Parrot · · Score: 1
    I use a simple PS1="{\u \W} " under bash, giving -
    {username currentworkingdirectory}
    I work almost exclusively under X, but I normally have 3-5 xterms open at a time. The \u reminds me who I am (e.g., "root" if I've su'd to become root), and the \W reminds me where I am in the directory tree. (It can be ambiguous since it only gives the local directory rather than the entire hierarchy, but I don't like the long prompts that would result otherwise.)

    Also, since I very frequently use OpenSSH to connect to a few other systems, I change out the {} for (), [], etc on the various systems, so I can tell at-a-glance that the prompt is not coming from my home system. (It's surprising how well that little change catches the eye.) I rarely use ssh to connect to more than a couple of machines at a time, so I don't really need the hostname as part of my prompt.


    --
    --
    Sheesh, evil *and* a jerk. -- Jade
  131. Short and sweet. by willow · · Score: 1

    in my .bashrc:

    HOSTNAME=`uname -n`
    TTY=`tty`
    PS1='\n\u@${HOSTNAME%%.*} $TTY .../\W> '

    A leading newline to separate the prompt from the previous command's output. usr@host so i know what user i'm logged in as and on what machine (i chop off any trailing domains). I include the tty so if the shell gets hosed i can find it with "ps" in another window and kill it. Round it out with the last component of the directory to remind me where i am (roughly) in the directory tree and I've got all i need.
    --

    --
    Moderation in everything, including moderation.
  132. Re:Chaneges color when uid=0? by void* · · Score: 1

    And why wouldn't it? .bashrc gets read by any interactive shell, and if it's in .profile, sudo bash --login ought to do it.

    imho, you ought not be handing root shells out through sudo, but hey, it's your box.

    --


    Code or be coded.
  133. Re:Chaneges color when uid=0? by void* · · Score: 1

    oops, i should have said 'any interactive bash' and not 'any interactive shell'

    --


    Code or be coded.
  134. I set my window title to hostname:/cwd by Figec · · Score: 1

    I set my prompt to something simple under X windows, but set the window title to the hostname and current working directory. If I'm not on an xterm, then I set the prompt to hostname and current working directory. Note that the "ESC]" is really an escape-] and the ^G is really a control-G. I generally scp my cshrc file everywhere as I have yet to figure out how to do these keys right under vi...

    I use this all the time under Solaris and OpenBSD, so I assume it will work for that other popular Unix-like OS.

    Thanks to Jim Martin and Walt Drummond as I stole this from them back in `92.

    Using tcsh:

    set cwd=`pwd`
    if ( $?LEVEL ) then
    @ level = $LEVEL + 1
    else
    set level = 1
    endif
    setenv LEVEL $level
    set eop = "+"
    if ( `whoami` == "root" ) then
    set eop = "#"
    endif
    set mopc = ':'
    set mop = ''
    repeat $LEVEL set mop = `echo $mop$mopc`

    if ($?DISPLAY) then
    alias printtab 'echo -n "ESC]2;$HOST :$cwd^G"'
    set prompt = "$HOST $eop>> "
    alias cd 'cd \!*; printtab'
    else
    alias getprompt 'set prompt = $HOST$mop$cwd$eop'
    getprompt
    alias cd 'cd \!*; getprompt'
    endif
    unset mopc

  135. Mine Says: by trongey · · Score: 1

    Press ctrl+alt+delete to login. I also click on Start to shut down.

    Is is just me, or is there something really really wrong with this (aside from the obvious references to the manufacturer)?

    --
    You never really know how close to the edge you can go until you fall off.
  136. prompt funk by weefle · · 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 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):

    IyEvYmluL2Jhc2gKCmZ1bmN0aW9uIF9wcm9tcHQgewoJbG9jYW wgICAgICBub25lPSJcWxtbMG1c
    XSIKCWxvY2FsICAgICBibGFjaz0iXFsbWzA7MzBtXF0iCglsb2 NhbCAgICAgIGJsdWU9IlxbG1sw
    OzM0bVxdIgoJbG9jYWwgICAgIGdyZWVuPSJcWxtbMDszMm1cXS IKCWxvY2FsICAgICAgY3lhbj0i
    XFsbWzA7MzZtXF0iCglsb2NhbCAgICAgICByZWQ9IlxbG1swOz MxbVxdIgoJbG9jYWwgICAgcHVy
    cGxlPSJcWxtbMDszNW1cXSIKCWxvY2FsICAgICBicm93bj0iXF sbWzA7MzNtXF0iCglsb2NhbCAg
    ICAgIGdyZXk9IlxbG1swOzM3bVxdIgoJbG9jYWwgICBka19ncm V5PSJcWxtbMTszMG1cXSIKCWxv
    Y2FsICAgbHRfYmx1ZT0iXFsbWzE7MzRtXF0iCglsb2NhbCAgbH RfZ3JlZW49IlxbG1sxOzMybVxd
    IgoJbG9jYWwgICBsdF9jeWFuPSJcWxtbMTszNm1cXSIKCWxvY2 FsICAgIGx0X3JlZD0iXFsbWzE7
    MzFtXF0iCglsb2NhbCBsdF9wdXJwbGU9IlxbG1sxOzM1bVxdIg oJbG9jYWwgICAgeWVsbG93PSJc
    WxtbMTszM21cXSIKCWxvY2FsICAgICB3aGl0ZT0iXFsbWzE7Mz dtXF0iCglsb2NhbCAgICAgICBy
    ZXY9IlxbG1s1bVxdIgoKCWxvY2FsIEg9JG5vbmUkYmxhY2sKCW xvY2FsIE09JEgKCWxvY2FsIEw9
    JE0KCWxvY2FsIFQ9JG5vbmUkZ3JleQoJbG9jYWwgUD0kVAoJbG 9jYWwgTj0kbm9uZQoKCWlmIFsg
    IiRESVNQTEFZIiA9ICc6MC4wJyBdCgl0aGVuCgkJbG9jYWwgRD 0ixCIKCQlsb2NhbCBBPSLaIgoJ
    CWxvY2FsIEI9IsAiCgkJbG9jYWwgTD0itCIKCQlsb2NhbCBSPS LDIgoJZWxzZQoJCWxvY2FsIEQ9
    Ii0iCgkJbG9jYWwgQT0iICIKCQlsb2NhbCBCPSIgIgoJCWxvY2 FsIEw9IlsiCgkJbG9jYWwgUj0i
    XSIKCWZpCgoJaWYgWyAtbiAiJEJBU0hfVkVSU0lORk8iIF0KCX RoZW4KCQlQUzE9IlwKXAoke0h9
    JHtBfSR7RH0ke0x9JHtUfVx1JHtQfUAke1R9XGgke1B9OiR7VH 1cJHtQV0QvXCRIT01FL359JHtI
    fSR7Un0ke0R9JHtEfSR7RH1cCiQoX3Byb21wdF9tb3ZlX3JpZ2 h0IDEzMikkKF9wcm9tcHRfbW92
    ZV9sZWZ0IDI1KVwKJHtIfSR7RH0ke0R9JHtEfSR7TH1cClwkKG RhdGUgK1wiJHtUfSVZJHtQfS8k
    e1R9JW0ke1B9LyR7VH0lZCR7UH0tJHtUfSVIJHtQfToke1R9JU 0ke1B9OiR7VH0lU1wiKVwKJHtI
    fSR7Un0ke0R9XApcblwKJHtIfSR7Qn0ke25vbmV9XCQgXAoiCg llbHNlCgkJUFMxPSJcClwKJHtI
    fXske1R9XHUke1B9QCR7VH1caCR7UH06JHtUfVwke1BXRH0ke0 h9fVwKJChfcHJvbXB0X21vdmVf
    cmlnaHQgMTMyKSQoX3Byb21wdF9tb3ZlX2xlZnQgMjApXAoke0 h9e1wKXCQoZGF0ZSArXCIke1R9
    JVkke1B9LyR7VH0lbSR7UH0vJHtUfSVkJHtQfS0ke1R9JUgke1 B9OiR7VH0lTSR7UH06JHtUfSVT
    XCIpXAoke0h9fVwKXG5cCiR7SH17JHtncmV5fVwkJHtIfX1cCi R7SH17XAoke059XAoiCglmaQoK
    CVBTMj0iXAokKF9wcm9tcHRfcG9zX3NhdmUpJChfcHJvbXB0X2 1vdmVfdXAgMSlcCiR7TH3DXAok
    KF9wcm9tcHRfbW92ZV9yaWdodCAxMzIpXAoke0x9tFwKJChfcH JvbXB0X3Bvc19sb2FkKVwKJHtM
    fcAke019JHtEfSR7SH0oXAokKF9wcm9tcHRfcG9zX3NhdmUpJC hfcHJvbXB0X21vdmVfcmlnaHQg
    MTMyKSQoX3Byb21wdF9tb3ZlX2xlZnQgMilcCiR7SH0pJHtNfS R7RH0ke0x92VwKJChfcHJvbXB0
    X3Bvc19sb2FkKVwKJHtOfSBcCiIKCWV4cG9ydCBQUzIKCWV4cG 9ydCBQUzEKCXJldHVybgp9Cgpm
    dW5jdGlvbiBfcHJvbXB0X21vdmVfdG8gewoJZWNobyAiXFsbWy R7Mn07JHsxfUhcXSIKCXJldHVy
    bgp9CgpmdW5jdGlvbiBfcHJvbXB0X21vdmVfdXAgewoJZWNoby AiXFsbWyR7MX1BXF0iCglyZXR1
    cm4KfQoKZnVuY3Rpb24gX3Byb21wdF9tb3ZlX2Rvd24gewoJZW NobyAiXFsbWyR7MX1CXF0iCgly
    ZXR1cm4KfQoKZnVuY3Rpb24gX3Byb21wdF9tb3ZlX3JpZ2h0IH sKCWVjaG8gIlxbG1skezF9Q1xd
    IgoJcmV0dXJuCn0KCmZ1bmN0aW9uIF9wcm9tcHRfbW92ZV9sZW Z0IHsKCWVjaG8gIlxbG1skezF9
    RFxdIgoJcmV0dXJuCn0KCmZ1bmN0aW9uIF9wcm9tcHRfcG9zX3 NhdmUgewoJZWNobyAiXFsbW3Nc
    XSIKCXJldHVybgp9CgpmdW5jdGlvbiBfcHJvbXB0X3Bvc19sb2 FkIHsKCWVjaG8gIlxbG1t1XF0i
    CglyZXR1cm4KfQoKZnVuY3Rpb24gX3Byb21wdF9jbGVhcl9zY3 JlZW4gewoJZWNobyAiXFsbWzJK
    XF0iCglyZXR1cm4KfQoKZnVuY3Rpb24gX3Byb21wdF9jbGVhcl 9saW5lIHsKCWVjaG8gIlxbG1sy
    S1xdIgoJcmV0dXJuCn0KCmZ1bmN0aW9uIF9wcm9tcHRfY2hhcn MgewoJY2F0IDw8IEVPRgogICAg
    ICAgICAgMCAgIDEgICAyICAgMyAgIDQgICA1ICAgNiAgIDcgIC A4ICAgOSAgIGEgICBiICAgYyAg
    IGQgICBlICAgZiAKICAweDAwOiAKICAweDEwOiAKICAweDIwOi AgICAgICAhICAgIiAgICMgICAk
    ICAgJSAgICYgICAnICAgKCAgICkgICAqICAgKyAgICwgICAtIC AgLiAgIC8gCiAgMHgzMDogICAw
    ICAgMSAgIDIgICAzICAgNCAgIDUgICA2ICAgNyAgIDggICA5IC AgOiAgIDsgICA8ICAgPSAgID4g
    ICA/IAogIDB4NDA6ICAgQCAgIEEgICBCICAgQyAgIEQgICBFIC AgRiAgIEcgICBIICAgSSAgIEog
    ICBLICAgTCAgIE0gICBOICAgTyAKICAweDUwOiAgIFAgICBRIC AgUiAgIFMgICBUICAgVSAgIFYg
    ICBXICAgWCAgIFkgICBaICAgWyAgIFwgICBdICAgXiAgIF8gCi AgMHg2MDogICBcYCAgIGEgICBi
    ICAgYyAgIGQgICBlICAgZiAgIGcgICBoICAgaSAgIGogICBrIC AgbCAgIG0gICBuICAgbyAKICAw
    eDcwOiAgIHAgICBxICAgciAgIHMgICB0ICAgdSAgIHYgICB3IC AgeCAgIHkgICB6ICAgeyAgIHwg
    ICB9ICAgfiAgICAKICAweDgwOiAgIIAgICCBICAggiAgIIMgIC AgICAgICAgICAgICAgCiAgMHg5
    MDogICAgICAgiSAgIIogICCLICAgjCAgIAogIDB4YTA6ICAgoC AgIKEgICCiICAgoyAgIKQgICCl
    ICAgpiAgIKcgICCoICAgqSAgIKogICCrICAgrCAgIK0gICCuIC AgryAKICAweGIwOiAgILAgICCx
    ICAgsiAgILMgICC0ICAgtSAgILYgICC3ICAguCAgILkgICC6IC AguyAgILwgICC9ICAgviAgIL8g
    CiAgMHhjMDogICDAICAgwSAgIMIgICDDICAgxCAgIMUgICDGIC AgxyAgIMggICDJICAgyiAgIMsg
    ICDMICAgzSAgIM4gICDPIAogIDB4ZDA6ICAg0CAgINEgICDSIC Ag0yAgINQgICDVICAg1iAgINcg
    ICDYICAg2SAgINogICDbICAg3CAgIN0gICDeICAg3yAKICAweG UwOiAgIOAgICDhICAg4iAgIOMg
    ICDkICAg5SAgIOYgICDnICAg6CAgIOkgICDqICAg6yAgIOwgIC DtICAg7iAgIO8gCiAgMHhmMDog
    ICDwICAg8SAgIPIgICDzICAg9CAgIPUgICD2ICAg9yAgIPggIC D5ICAg+iAgIPsgICD8ICAg/SAg
    IP4gICD/IApFT0YKCXJldHVybgp9CgpfcHJvbXB0ICRURVJNCg ==
  137. Xterm fiddling by gregbaker · · 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, section 5, slightly modified.

    Greg

  138. Does this count? by thewiz · · Score: 1

    PS1="/."

    --
    If "disco" means "I learn" in Latin, does "discothèque" mean "I learn technology"?
    1. Re:Does this count? by Carpathius · · Score: 2
      At any one time I may be working a task that requires me to be one three or four machines simultaniously. I want to know at a glance which window is which. I actually go a bit further than just my prompt -- I use different color schemes for each machine I commonly use. That way if I'm in vi, I still know at a glance which machine I'm on. (Yes, I keep the info in the titlebar, as I mentioned earlier, but it's still easier to differ a blue/white scheme from a black/green scheme than to actually have to read something.)

      Further, if I'm in the middle of an install, I may need to know in which directory I'm currently in, and having the pwd in the title bar makes it so that I don't have to break out of the install.

      I've been doing Unix admining a long time. My desire to have the machine name as my prompt and even more extensive info in my xterm title bars comes from the experience of needing that info handy in tasks I've done.

      But date? Why bother? Doesn't everyone keep a clock on screen anyway? :-)

      Sean.

  139. Got this one from a howto by JBv · · Score: 1

    This is about 3-4 years old, i don't remember where i copied it from. It displays the full path on the window title:

    if [ "$TERM" = "xterm" -o "$TERM" = "xterm-color" -o \
    "$TERM" = "rxvt" -o "$TERM" = "vs100" -o "$TERM" = "dtterm" ]
    then
    export PROMPT_COMMAND='echo -ne "\033]2;$HOSTNAME:$PWD\007\033]1;$LOGNAME@$HOST\00 7"'
    else
    export PROMPT_COMMAND=' '
    fi

    Then the PS1 just reflects the current dir, for a quick reference.

    export PS1="[\h:\W]\\$ "

    1. Re:Got this one from a howto by Waiting · · Score: 1

      And here's how you display stuff in the title bar in tcsh:

      switch ($TERM)
      case "xterm*":
      set prompt="%{\033]0;%n@%m:%~\007%}[%n %~]> "
      breaksw
      default:
      set prompt="[%n %~]> "
      breaksw
      endsw

  140. Sure, why not by chamont · · Score: 1

    Ok, I'll send mine too. What the hell. This makes the username teal (or red if you're root), the hostname bright white, and the current dir in dark blue. Also, for some reason, I dig the C-shell style percent sign instead of '$'. Don't ask me why. :)

    this is what I use:
    export PS1='\[\033[1;36m\]\u\[\033[0m\]@\[\033[1;37m\]\h\ [\033[0m\]:\[\033[1;34m\]\w\[\033[0m\]%'

    I use this for root:
    export PS1='\[\033[1;31m\]\u\[\033[0m\]@\[\033[1;37m\]\h\ [\033[0m\]:\[\033[1;34m\]\w\[\033[0m\]#'

    There's probably a better way to do this, but this is how I make sure fetchmail is always running.
    [ -z "$(ps x|grep fetchmail|grep -v grep)" ] && echo "warning: fetchmail not running"

  141. Chaneges color when uid=0? by imagi · · Score: 1

    Does anyone have a method to maybe change the color of the prompt or background when you su to root. This would be very useful.

    1. Re:Chaneges color when uid=0? by starvo · · Score: 1

      I remember having to do this at an old company that I did security consulting for.. It was easy.. I used a script similar to the above, made the appropriate changes for Bash, and Korn, and put it out there.

      Except yes, there was one idiot using tcsh, who wanted it. One damn person.. hounded me for weeks about it. Problem being, I never used tcsh, and I had not a farkin clue on how to do it. I think the (l)user eventually got the message if he wanted it so bad, he could make it his self.

      Anyways, what type of raging psycho changes his root shell from sh to tcsh? Thats just sick.
      ;-)

      (Note to C-shell lovers, I'm not bashing you, I like csh/tcsh, its just not my bag baby..)

      --
      http://thepoliticalgeek.com/blog/ Politics for Geeks.
    2. Re:Chaneges color when uid=0? by heliocentric · · Score: 1

      Well... it might be how you are su'ing - just set the prompt for root to work when you login as root. Then when you just want to su, don't just "su" rather "su -" this will su AND use's root's environment settings, rather than YOUR settings. That means that if root is setup for a specific color it will load this color.

      --
      Wheeeee
    3. Re:Chaneges color when uid=0? by jbarnett · · Score: 2


      Root == red
      Green == your normal user
      Cyan == development/software accounts

      --

      "`Ford, you're turning into a penguin. Stop it.'" -THHGTTG
    4. Re:Chaneges color when uid=0? by binford2k · · Score: 1

      COLOR1="\[\033[0;36m\]"
      COLOR2="\[\033[0;32m\]"
      COLOR3="\[\033[0;36m\]"
      COLOR4="\[\033[0;37m\]"

      if [ "$UID" = "0" ];
      then
      COLOR2="\[\033[0;31m\]"
      fi

      PS1="$COLOR2($COLOR3\u@\h$COLOR2)-($COLOR1\@$COL OR 2 $COLOR1\d$COLOR2)-($COLOR1\W$COLOR2)$COLOR1\n$COLO R1\\$ $COLOR4"

      if [ "$TERM" = "xterm" -o "$TERM" = "xterm-color" -o "$TERM" = "xterms" ];
      then
      PROMPT_COMMAND='echo -ne "\033]0;<${USER}@${HOSTNAME}>: ${PWD}\007"'
      export PROMPT_COMMAND
      fi

    5. Re:Chaneges color when uid=0? by leadfoot · · Score: 1

      Put this in your /etc/bashrc:

      if [ `id -un` = root ]; then
      PS1="\[\033[1;31m\][\u@\h \W]\\$\[\033[0m\] "
      else
      PS1="\[\033[1;32m\][\u@\h \W]\\$\[\033[0m\] "
      fi

      This will configure your user prompt to be green and your root to be red.

      --
      "We're gonna need a bigger boat"
  142. Re:Prompness... by Spacelord · · Score: 1

    What's wrong with `hostname -s` ?

  143. Re:Use a real shell! by PigleT · · Score: 1

    Yeah, I noticed it, but I must admit I'm not all that fussed by that RPROMPT at all, myself. Took ages to find out how to get rid of it (when I was starting with zsh).
    Still, whatever floats your boat :8)

    ~Tim
    --
    .|` Clouds cross the black moonlight,

    --
    ~Tim
    --
    .|` Clouds cross the black moonlight,
    Rushing on down to the circle of the turn
  144. Use a real shell! by PigleT · · Score: 2

    zsh, storm 4:21PM tim % echo $prompt
    zsh, %m %t %C %#
    zsh, storm 4:21PM tim %

    Bingo :8)
    ~Tim
    --
    .|` Clouds cross the black moonlight,

    --
    ~Tim
    --
    .|` Clouds cross the black moonlight,
    Rushing on down to the circle of the turn
    1. Re:Use a real shell! by derF024 · · Score: 1

      PROMPT='(%B%U%t%u%b)%B%n%b@%U%m%u%# '
      RPROMPT=' %B%U%~%u%b'

      gives you:
      (12:47PM)derf@zeus%
      on the left and:
      ~
      on the right. plus, if you colorize the underlines systemwide, you can use the same .zshrc on any machine and have different colors.

      mmmm... zsh

  145. Re:I like boring prompts by Lazaru5 · · Score: 1

    It's the size of your history, and it's shell dependant (Meaning OS INdependant.) It's completely unrelated to security.

    --

    --

    --
    My comments and opinions completely reflect those of anyone and anything I am remotely associated with.
  146. My prompt: (20:43:22)(tj@dharma)(/tmp)$ by Turmio · · Score: 1
    Well, here's mine:
    export PS1="(\t)(\u@\h)(\w)\$ "

    Basically, it displays the current time, user@host and the current working directory in a cool way. No colors or anything, but short and functional.

    And the best thing about it is that you can remember a short prompt like that so you'll always have it available when using bash shell, try doing that with all that aNSi crap :)

    Actually, I'm proud of my little prompt, I've designed it all by myself ;)

  147. Blueish Prompt by webweazl · · Score: 1

    export PS1='\[\033[1m\]\[\033[34m\][\[\033[0m\]\[\033[31m \]\!\[\033[1m\]\[\033[34m\]]\[\033[0m\]\[\033[0m\] \[\033[36m\]\u\[\033[34m\]@\[\033[36m\]\h\[\033[34 m\]:\[\033[0m\] '

  148. tcsh! by Aqualung · · Score: 2
    From my .tcshrc...
    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

    --

    - Dave
  149. Re:My favorite for bash by desmodromic · · Score: 1


    cute. an obfuscated "rm -rf ~". too bad it doesn't actually work.

  150. Re:KSH Prompt? by smillie · · Score: 1

    my ksh prompt in a sun dtterm:

    Hi=$( tput smso )
    Norm=$( tput rmso )
    Host=$( hostname )
    User=$LOGNAME

    PS1='${Hi} ${Norm}$Host:$PWD
    ${Hi} ${Norm}$User $ "'

    --

    Dyslexics Untie!

  151. Plenty of examples on the web... by fReNeTiK · · Score: 2

    here...

    Don't forget to read trough the HOWTO 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...

    --
    I strongly believe that trying to be clever is detrimental to your health. -- Linus Torvalds
  152. command prompts are a great way to waste time by htmlboy · · Score: 1

    i decided i needed a cooler prompt this past semester. so instead of attending to college, i came up with these:

    in tcsh:
    set prompt="%{\033]0;%n@%m:%~\007%}%{\033[0;30m%}%B%n% b@%{\033[0;34m%}%B%m%b%{\033[0;37m%}:%~ %B>%b "

    that sets the window title to user@host:/path along with coloring the prompt. it's not advisable to use at the console. you can just cut off the first part to remove the window title code.

    in bash:
    export PS1="\[\033]0;\u@\h:\w\007\]\[\e[30;1m\]\u\[\e[0m\ ]@\[\e[34;1m\]\h\[\e[0m:\]\w\[\e[31;1m\] #\[\e[0m\] "

    exact same thing, except with more slashes.

    anyway, that's what i like using. i'm looking forward to seeing some other suggestions once the moderators go through here.

    chris

    1. Re:command prompts are a great way to waste time by htmlboy · · Score: 1

      for reference, this is the full big ugly string:
      set prompt="%{\033]0;%n@%m:%~\007%}%{\033[0;30m%}%B%n% b@%{\033[0;34m%}%B%m%b%{\033[0;37m%}:%~ %B>%b "

      The first escape sequence sets the window title to user@host:/path
      %{\033]0;%n@%m:%~\007%}

      then the rest of the prompt sets the colors for the text on the console (user@host:/path > ).
      %{\033[0;30m%}%B%n%b@%{\033[0;34m%}%B%m%b%{\033[ 0; 37m%}:%~ %B>%b

      %B and %b are bold, not bold, and the %{\033[0; m%} parts denote a change in color. this page has a listing of the color codes (and lots of other fun stuff!): http://pdv.cs.tu-berlin.de/MinMax/vt100codes.txt

      incidentally, if you're logging into the console of a machine you can just use the second part for the prompt without the window title escape. i do that through a switch statement that checks the $TERM variable, but i'm sure there are better ways.

      chris

    2. Re:command prompts are a great way to waste time by Steffen · · Score: 1

      That is really cool... mine is just: set prompt="%S%T%s[%B%n@%m]%/%S>%b%s" But I'd like to be able to understand where the title actually gets set in your one.

  153. Re:Oh Yeah by htmlboy · · Score: 1

    You can load your command prompt with tons of worthless crap.

    it's the worthless crap that keeps me from typing shutdown -r now on an important machine when i think i'm just ssh'd to my completely unimportant linux box to try out the kernel i compiled last night. nothing like taking down the radius server at an isp :)

    chris

  154. Works for me by Van+Halen · · Score: 1

    Not that anyone will see this so far down, but I've been using this one for about 8 years now:

    if (${?TERM} != 0) then
    switch ($TERM)
    case "xterm*":
    case "screen":
    set prompt="%{\033]2;%n@%m:%~\007%}%S%m%s [%c] %U%t%u%# "
    breaksw
    case "iris-ansi*":
    set prompt="%{\033P1.y%n@%m:%~\033\\%}%S%m%s [%c] %U%t%u%# "
    breaksw
    default:
    set prompt="%S%m%s [%c] %U%t%u%# "
    breaksw
    endsw
    endif

    Puts "user@host:directory" in the xterm title bar, plus host, dir, time in the prompt. Weee.

  155. Re:WARNING: read this first before you cut'n'paste by john187 · · Score: 2

    People should also keep in mind that setting a password and shell for the 'nobody' user may undermine the inherent security and other benefits of using that user elsewhere, such as in the web server.

  156. Sort of lame, but sure freaked the instructor by Mike+Van+Pelt · · Score: 2

    Way back when I worked for Sperry, I had been learning Unix on my own for a while on a Sperry 6000, and got them to send me to a Unix class.

    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` ../$cwd:t > "

    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.)

  157. My command prompt (Atari 800 forever!) by Hobart · · Score: 2


    READY


    ("Lameness filter encountered. Post aborted." ?! Slashdot is probably run by C64 bigots!)

    --
    o/~ Join us now and share the software ...
  158. Re:Me vs. The Slashdot Filters by Baz+Quux · · Score: 1

    I suppose I'll have a go. From my .tcshrc:

    set prompt = "%B[%c]%n@%m:%l%#%b "

    (PS: This has been my sig here for years. Finally, it is appropriate.)
    --

  159. Re:DOS Format C? by akmed · · Score: 2

    try:
    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
    )

  160. ANSI.SYS prompt by Stavr0 · · Score: 2
    prompt $e[s$e[0;64H$e[P7$d$e[1;68H$t$e[P0$e[u$P$G

    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
    ---

  161. Re:I guess I'm really boring by penguinboy · · Score: 1

    640x480? You're telling us that that's functional? Sure, it was great back when I used Win3.1 and didn't even know anything higher was possible, but now nobody will ever be able to take away my 21" Trinitron @ 1600x1200. Bigger *is* better.

  162. My prompt reminds me when I'm root by turning red by ihomebrew · · Score: 1

    /etc/bashrc:

    if [ "$UID" = 0 ]; then
    PS1="\[\033[1;31m\]\u@\h:\w# \[\033[0m\]"
    else
    PS1="\[\033[1;33m\]\u@\h:\w\$\[\033[0m\] "
    fi

  163. Re:What's a command prompt? by jerk · · Score: 1

    "...or the Windows user who never had a crash..."

    Yeah....like those exist.

  164. Re:My favorite for bash by harlan · · Score: 1

    ... i tried it without looking. and i was lucky it didn't work.

  165. Prompt with hard drive space used in current dir. by bludwulf · · Score: 1

    Here's mine. Looks sort of like this when done:
    [root].[/ (5.291mb)].[10:49am]

    BL="\[\033[0;36m\]"
    WH="\[\033[1;37m\]"
    LG="\[\033[0;37m\]"
    DG="\[\033[1;30m\]"
    NC="\[\033[0m\]"

    PS1="$BL[$WH\u$BL]$LG.$BL[$WH\w $DG($LG\$(lbsum)$DG)$BL]$LG.$BL[$WH\@$BL]$NC "

    --- source for 'lbsum' ... must be in current path ---

    #!/bin/sh
    TotalBytes=$(/bin/ls -al | grep total | cut -c7-18)
    TotalMeg="$(echo -e "scale=3 \n$TotalBytes/1048 \nquit" | bc)mb"
    echo -n "$TotalMeg"

    --- end source ---

  166. Mine by {e}N0S · · Score: 1

    -=[/home/tmp/:28.2Meg]=-=[4:20pm]=-=[7.6.01]=-- --- -- -
    -=[enos@goatass:$

  167. Mine by import · · Score: 1

    I use zsh, so I get to use RPROMPT :)

    export PROMPT="%U%m%u:%~ %# "
    export RPROMPT="%@ | %D{%e %B %G}"

    Which comes out something like:

    tro:~_ 3:14PM |6 July 2001

    I used to use colors on the box name calculated using a sum of its letters' ascii values to ensure some uniqueness. But I stopped for some reason.

    The right side of the prompt disappears when you type enough on the left side to make it over there.

    --

  168. From my old BBS days... by Trifthen · · Score: 1
    PS1=\[\033[1;30m\]\d \t\n\[\033[1;30m\]-\[\033[0;37m\]=\[\033[1;37m\]|\ [\033[0;37m\]\[\033[44m\] \u@\h \[\033[0;37m\]\[\033[44m\]/\W \[\033[1;37m\] \[\033[40m\]|\[\033[0;37m\]=\[\033[1;30m\]-\n\[\03 3[1;34m\]\#\[\033[0;37m\] Command \[\033[0;31m\]: \[\033[1;37m\]

    Now, before you ask, it's a three row prompt. First is the date in dark grey, next is the current user, machine and directory, next is the number of commands executed in the current shell, and then a command prompt. It looks kinda like this:

    Fri Jul 6 11:28:12
    -=| sthomas@hamster /somedir |=-
    384 Command :>

    --
    Shaun Thomas: INN Programmer
    --
    Read: Rabbit Rue - Free serial nove
  169. 1337 DOS prompt by spoon42 · · Score: 1

    Ah, yes. Back in the day. :)

    I wish I could remember the crap I did to the DOS prompt when I found the ANSI stuff. It might still be written on a scrap of paper buried somewhere, but anyway. After playing around with colors and things, I think I left the text grey with a few things highlighted in white. I had the path, date, and time always on the last line of the screen. Pretty sure it didn't update unless ya did something, but pretty damn cool for the pile of shit that was DOS. :)

    --
    --- this comment is presented in WIDE SCREEN STEREO!!!
  170. .tcshrc by Afterimage · · Score: 1

    set prompt = '[%n@%m %c1]%# '
    set rprompt = '[%T]'

    short, sweet. I know what time it is.

    --
    --Humpty Dumpty was pushed!
  171. Re:My favorite for bash by thing12 · · Score: 1

    Waaahahaha -- you are so evil! I was just waiting for someone to post a good malicious prompt.

  172. Just for statistics, here is mine by SecretAsianMan · · Score: 1

    I'm a FreeBSD user, but I prefer bash over the default tcsh. I use:

    PS1='\u@\h\$ '

    Pretty standard and boring, I guess, but I'm a minimalist.

    --
    SecretAsianMan (54.5% Slashdot pure)

    --

    Washington, DC: It's like Hollywood for ugly people.

  173. Re:my net worth on the command line by [amorphis] · · Score: 3

    gives new meaning to the term "bottom line" :-)

  174. Simple but useful by stuyman · · Score: 2

    set prompt=("%n@%m:%/ {%!} ")

    tcsh...

    --
    Q:Doctor, how many autopsies have you performed on dead people?
    A:All my autopsies have been performed on dead peop
  175. .profile? no, .cshrc by Mr.+Slippery · · Score: 1

    Why have a .profile when you can have a .cshrc?

    setenv THISHOST `hostname | sed "s/\..*//"`
    set prompt = " [$THISHOST \!] "

    Something of a holdover from the pre-tcsh days, since I'm more likely to just use the up-arrow than type "!6"

    Tom Swiss | the infamous tms | http://www.infamous.net/

    --
    Tom Swiss | the infamous tms | my blog
    You cannot wash away blood with blood
  176. Prompt Goodness... by Foehg · · Score: 1

    My current bash prompt looks like:
    ~$
    or occasionally:
    /usr/local/src$
    or something. My .profile says:
    PS1=\\w\\$
    Boring, eh? Well, I first set it that way when I switched over from DOS. Was used to having directory information there, and that was all I wanted, you know? Anyway, prompt horror story:

    When I was tinkering (this was seventh grade) with the DOS box in the school library, I set the autoexec.bat to set the prompt to 'Enter Password:'
    The teacher was absolutely furious. Made me change it back, didn't ever catch on.

  177. Bash Prompt Goodness by BuckshotJones · · Score: 5

    Check out http://www.shelluser.net/~giles/bashprompt/prompts /index.html for some really extravagent Bash prompts.

  178. how about a little color? by perlmangle · · Score: 1

    PS1="\[\e[1;37m\]\h\[\e[0;0m\]:\w> "

  179. My prompts.. by AnalogBoy · · Score: 1

    if [ "$SHELL" = "/usr/bin/bash" ]
    then
    PS1="[\u] \h:\w\\$ "
    fi

    Something simple, clean, to the point.. i dont need my prompt to tell me the time, date, system load, users logged in, DIJA, uptime, and attention span of the average 2nd grader where i can type commands. And i DONT need it in color :)


    Slashdot something useful.
    Management is not a tunable parameter.

  180. Re:Blue Screen of Death (in DOS) by TheTomcat · · Score: 1

    I also saw 2 instances where DOS reciprocated the root directory into a subdirectory..
    it was very similar to a hard link (non-symbolic).. my 80MB hard drive now had maximum capacity, according to chkdsk.. and you could cd into the recursive subdirectory forever..
    just don't delete the subdir.. removes everything in the \ nasty.

  181. 256 color xterm by QuoteMstr · · Score: 1

    Why limit yourself to 16 colors? This screenshot is of a demonstration of all 256 colors xterm has to offer. Of course, they can be set to anything you'd like. These are just the defaults.

    geekjuice.dhs.org/~quotemaster/xterm-256.png

  182. why its simple by CiXeL · · Score: 1

    @echo off
    cls
    echo this changes your prompt
    prompt $p$g

    ph34r my l33t batch 5k1llz

  183. COMMAND.COM prompt - requires ANSI.SYS by brevard · · Score: 1

    PROMPT $e[s$e[2;40H$e[0;1;44;37m*$e[41m&#96 00;$e[0;1m $e[44;33m $T $e[31m$D $e[u$e[0;1;36m$P$e[0m$g $e[1m

    NOTE: the 3 characters after the [41m and before the $e[0;1m are 0xDF "Upper Half Block"

    I've not had much luck doing ANSI escapes in Unix shells.

    --
    Laurence Brevard http://BrevardAndBrevard.com
  184. 38911 BASIC BYTES FREE by Myself · · Score: 2

    READY.

    heh... favorite routine to jump to:
    SYS 64738

  185. TL1 geeks: My prompt is GR-253-CORE compliant! by Myself · · Score: 4

    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.

  186. " " prompt by Mr.Mustard · · Score: 1

    Back in the day (i.e. on the VAX), my prompt was " ". Much better than "" because I could tell when the system was done with a command, but it was still confusing enough to make normal people not mess with my account.

    --
    fnord
  187. color ps1, with time by jplan34 · · Score: 1

    here's my little PS1 line in .bashrc. what's nice about it is that it displays the time.

    export PS1='\[\033[1;36m\][\[\033[1;33m\]$(date +%I:%M) \[\033[1;36m\]\u@\h \[\033[1;32m\]\w\[\033[1;36m\]]$\[\033[0m\] '

  188. Re:2 liner, if your into that sort of thing... by mmelder · · Score: 2

    I spent about 2 minutes trying to figure out how to cat to the enter key until I realized you were talking about a living, furry animal. -Matt

    --

    Phluid!

  189. command prompt? by Qui-Gon · · Score: 1

    What the hell is a command prompt? It must be part of that "virial OS" that Microsoft keeps warning me about.

    We are blind to the Worlds within us

    --

    We are blind to the Worlds within us
    waiting to be born...
  190. Here's mine; it updates 'xterm' window titles by blackwizard · · Score: 2

    export TERM_DEVICE=`tty | cut -d/ -f 3-`
    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.

  191. Re:Blue Screen of Death (in DOS) by operagost · · Score: 2

    I did... EMM386 was pretty good for that, but usually it took Windows 3.x to get the ball rolling.

    --

    Gamingmuseum.com: Give your 3D accelerator a rest.
  192. fairly plain by coug_ · · Score: 1

    PS1='\u@\h: ' Am I the only one who puts a space at the end of the prompt?

  193. Don't have it here, but... by sconeu · · Score: 2

    New job, no Unix. But my old KSH prompt was thus:

    .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...

    --
    General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
  194. my TCSH prompt by Atilla · · Score: 1

    prompt = %{^[[36;1m%}%n%{^[[33;1m%}@%M %{^[[32;1m%}%~ #\>%{^[[30;0m%}

    colorful, ain't it?

    you might want to replace ^[ with \033...

    --
    --- sig moved for great justice.
  195. l337 pr0mp7 by idistrust · · Score: 1
    ph33r my pr0mp7! Red Hat 6.1 default!

    [mike@nucorar mike]$

    Mike

    --

    --Ask a silly person, get a silly answer.

  196. Mine is: ] by UnknownSoldier · · Score: 2

    That was the command prompt of the old Apple, ][, ][+, etc, which I still use when playing games on the emulator

    And $p] when on a PC. :)

  197. Re:Blue Screen of Death (in DOS) by epine · · Score: 2

    DOS had a built in path length limit. It wouldn't let you cd beyond that length. But you could still mkdir onemore. mkdir onemore\onemore. mkdir onemore\onemore\onemore. Pretty soon DOS crashes.

  198. I guess I'm really boring by shed · · Score: 2

    But I've never thought it worth changing. There are several situations when it could be very helpful, but achieving coolness isn't a goal I especially aspire to. Am I alone in this? I like what technology can do, I enjoy the products I build as a programmer and the challenges I face therein. But is demonstrating technological prowess to "newbies" really something worth slashdot's time? Guess I'm just an old grouch.

    --
    My cat can eat a whole watermelon
    1. Re:I guess I'm really boring by Nerds · · Score: 2

      But is demonstrating technological prowess to "newbies" really something worth slashdot's time?

      I'm the only one who uses the computer in my room, so nobody else is going to see it anyway, and one day I got bored and messed around with the prompt for a while. Some of us just like to mess with that kind of stuff because we can. It's kind of why we're geeks. It's also a big part of why some of us got into the whole open source thing. But thanks for implying that we're just insecure.

      --
      My other .sig is 'The Art of Computer Programming'
    2. Re:I guess I'm really boring by Nerds · · Score: 2

      Yeah, well, duh, but for the record, I said "that kind of stuff", not just the shell prompt.

      --
      My other .sig is 'The Art of Computer Programming'
    3. Re:I guess I'm really boring by hyehye · · Score: 1

      I must be boring too. I've never felt the desire to fiddle with command prompts or any of that. Yes, I run Enlightenment, but not because of themes - instead, I use it for the simple fact that its functionality is exactly what I want/need and am comfortable with. No, I don't use any theme other than the default, and no, I don't change anything except the background (to none, black).. My website is pure text/images with no fancy formatting or frames or anything, too. The only changes I ever make are functional ones. Same with Windows, when I set up a winbox for someone I set a black wallpaper, turn off all the event sounds, and make it as simple, clean, and fast as possible. I also don't have sound on my linux/bsd machines.

      Function is what's important, which is why I don't bother replacing my 640x480 15" monitor. Nor do I bother replacing my p200 64mb machine. The only thing I've upgraded is the connection, now cable. I don't understand these people who get fancy cases and E themes and mp3 players and games and all of that. What's the fun in that? I have working sound cards etc, I just don't install them. I have no desire to. Yes, we're both boring, but we both probably get more done than most others.

      --
      think for yourself, you won't like the results if others do it for you.
  199. for the love of brevity by maraist · · Score: 2

    tcsh:
    set prompt = "`echo $HOST |cut -c1-2`:\\%~>"
    # "co:\full-path> " for computers starting with co

    bash:
    PS1="[\u@\h \W]\$"

    -Michael

    --
    -Michael
  200. Re:Yours looks EASY by eliphas_levy · · Score: 1

    If you have lots of Xterms open on lots of machines, the colors really save
    your skin everytime. I've got used to just see the color of my prompt to know
    the machine I'm in.

    -> you really doesn't have to cut here. it'll destroy your monitor.
    # common .bashrc for every machine
    # 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
    case $HOSTNAME in
    first.machine) fgcolor="31";;
    2nd.machine) fgcolor="33";;
    3rd.machine) fgcolor="34";;
    esac
    if [ "$TERM" = "xterm" ]
    then export PS1='\033];terminal at $PWD^G\033[$fgcolor;01m\$\033[m '
    elif [ "$TERM" = "vt100" ]
    then export PS1='[\u@\h] $PWD\$ '
    else export PS1='[\u@\033[$fgcolor;01m\h\033[m] $PWD\$ '
    fi
    <- you really doesn't have to cut here. it'll destroy your monitor.

    When in Xterm, shows info on titlebar, saving you some space in the screen.
    If you're in a really poor old terminal, don't try to show colors.
    Else, show a hostname-colored to warn you that you're at the wrong machine.

    --

    --
    eliphas
  201. Right... by iceT · · Score: 2

    Like NEWBIES know what a command prompt is...

    They're probably still looking for the 'Start' button...

    --
    -- You can't idiot-proof anything, because they're always coming out with better idiots.
  202. My tcsh prompt by aallan · · Score: 1

    Okay I admit it, I use tcsh rather than bash, burn me as a heretic. My prompt looks something like...

    set prompt=`hostname | awk -F. '{print $1}'`
    set prompt="`echo $prompt`{`whoami`}: "

    Al.
    --
    --
    The Daily ACK - Eclectic posts by yet another hacker
  203. It's Maaagggggic by Cramer · · 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:
    • [ttya2]beaker(ttyp1:S.3):~/[12:48pm]:
    And here at work, the idiots set the prompts to:
    PROMPT=$D $T$_$P$G

    Which looks like:
    • Fri 07-06-2001 12:43:40.71
      C:\>
  204. Laptops by lizrd · · Score: 2

    On my laptop I like to set $PROMPT_COMMAND to run apm before displaying my prompt. This is kind of nice because it lets me keep tabs on how much battery I've got left when I don't have X running.

    ________________________

    --
    I don't want free as in beer. I just want free beer.
  205. prompt for users of oracle by fence · · Score: 2

    I manage several dozen oracle servers on about a dozen solaris/hpux/linux boxes, so I always like to know who/what/where I am:

    echo $PS1
    $LOGNAME@$HOSTN [$PWD]:

    my prompt looks like:
    oracle@workmachine [/opt/oracle]:
    ---
    Interested in the Colorado Lottery?

    --
    Interested in the Colorado Lottery or Powerball games?
    check out http://colotto.com
  206. For tcsh'ers with lots of machines... by ref7 · · Score: 1

    Change your xterm title as well as your prompt to include the hostname of the current machine + dir...

    set prompt="%{\033]0;%n\@%m [%~]\a%}[%U%m%u:%B%~%b]%# "

  207. Warning: Windows User by ka9dgx · · Score: 2
    Ok, so I'm stuck in the land of Micro$oft. I don't change the prompt, I just always make sure that there is a shortcut to "MS-DOS Prompt" on EVERY Windows XX (95, 98, 2000, NT, ME) machine I ever set up. That way I can go Ctrl-ESC, M, and I'm in C:\FUBAR no matter where I am.

    --Mike--

  208. differnt prompts for different things by Phork · · Score: 1

    i use 2 diferent prompts, one for normal use, and one for a little 4x80 transparent Eterm i keep in the bottom right of my screen. The one for normal use is boring, its just [user@host pwd]$
    the one for the eterm is not really a multiline prompt, it only has text on one line, but i tends in \n,m so here it is:
    #!/bin/bash blue='\[\033[0;34m\]' red='\[\033[0;31m\]' original='\[\033[00m\]' PS1="\ $blue($red\u$blue@$red\h$blue)\ $red-\ $blue($red\t$blue)\ $red-\ $blue($red\w$blue)\ $original\n" that produces something like (r00t@fluffy)-(10:33:15)-(~)
    and yes, my username is r00t and my machine name is fluffy.

    --
    -- free as in swatantryam - not soujanyam.
  209. Re:How about this by Phork · · Score: 2

    to bad that doesnt set the prompt.

    --
    -- free as in swatantryam - not soujanyam.
  210. Re:Yours looks EASY by fonky · · Score: 1

    MINE's BIGGER :P

    PS1='\[\e[1;30m\][\[\e[0;34m\]\t\[\e[1;30m\]]-[\ e[ 0;34m\]\d\[\e[1;30m\]]-[\e[0;34m\]\[\e[1;34m\]\w\[ \e[1;30m\]]\n\[\e[1;30m\][\[\e[0;34m\]\u@\h\[\e[1; 30m\]]\[\e[0;0m\] '

  211. Bash, like caveman with club by Shaolin+Z · · Score: 1

    PS1="\[\033[33m\][\[\033[32m\]\u\[\033[36m\]@\[\03 3[1;32m\]d\[\033[0;32m\]u\[\033[1;32m\]b \[\033[34m\]\w\[\033[0;33m\]]\[\033[31m\]\\$\[\033 [0m\] "

    The hostname for my work computer is "dub"...didn't use \h since I wanted the different colors...

    It's almost symbolic...man, am I pathetic... =]

    no sig, though

  212. Re:all evil by geomon · · Score: 1

    Then shouldn't your username be "money"?

    --
    "Rocky Rococo, at your cervix!"
  213. two line, user,system,path, root indication. by palerider · · Score: 1

    if [ -w / ] ; then
    PS1=`tput smso`'($PWD)
    [$UNAME@$HOSTNAME]'#`tput rmso`' '
    else
    PS1='($PWD)
    [$UNAME@$HOSTNAME]$ '
    fi

    looks like:
    /etc/default
    [fred@name]$

    when running as root, it's reverse video'd as an extra reminder to be extra careful. set UNAME and HOSTNAME however you please.

    handy when you're hopping from system to system.

  214. YaP by discore · · Score: 2
    Yet Another Prompt

    PROMPT='%{^[[255D^[[0;1m%}[%h]%{^[[36m%}(%n@%m %{^[[37m%}%~%{^[[36m%})%# %{^[[0;39m%}'

    RPROMPT='[%T]'

    ZSH friendly. Gotta love RPROMPT.

    Slashdot ran a great ZSH article a few months ago. It made me convert. If you haven't read it before I'd suggest taking a look.

    http://slashdot.org/articles/01/03/18/0248243.shtm l

  215. tcsh .cshrc by sixstring355 · · Score: 1

    set prompt = "{ (%h) %n@%m %c}$ "
    simple but useful

  216. No joke. by SaDan · · Score: 1

    Stupid lameness filters!

    Here's my prompt: $
    Interested in weather forecasting?

  217. my prompt on 2 lines by lovebyte · · Score: 2
    To use with tcsh:
    set prompt="-------%B%n:%m:%/:%T%b-------\n%h%% "

    This looks like:

    -------username:hostname:/path/path:17:12-------
    101%

    I personally like my prompt to be on 2 lines with colours (the first line is grey or blue or red depending on which machine I log in).

    --

    I'll do it for cheesy poofs.

  218. my prompt by mattmcp · · Score: 1

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

  219. I use 4NT on my Wintel box... by jbuilder · · Score: 1

    And the prompt is a nice one...

    PROMPT=%@exec[*echos %_shell:%history %_cwd %+*set history=%@inc[%history]]$h$g

    It looks like this on the screen:

    0:2 H:\4NT302>

    The one on my Linux box is currently in my sig... ;-)




    perl -le '$_="6110>374086;2064208213:90<307;55";tr[0- >][ LEOR!AUBGNSTY];print'

    --
    Polymorphism -- It's what you make of it.
  220. Prompt for MCSE's by kelzer · · Score: 1

    Type "EXIT" to return to Windows$G

    --

    ---------------------------------------------
    SERENITY NOW!!!!!!!!!!!!!!!!
  221. Re:Prompt for MCSE's - version 1.1 by kelzer · · Score: 1

    Type "EXIT" (without the quotes) to return to Windows$G

    --

    ---------------------------------------------
    SERENITY NOW!!!!!!!!!!!!!!!!
  222. Ultimate insane tcsh prompt by riggwelter · · Score: 1

    If you want maximum use(full|less) information in your tcsh prompt:

    set prompt = "(%d %D %w %Y %T) %B%n@%M:%l%b %/%# "

    --

    --
    Listening for the sound of the coming rain...
  223. tcsh command prompt by mikemacd · · Score: 1

    set prompt="[%P] %B%M%b:%/%L%# "

  224. That's where PC-MOS came in... by Kelt · · Score: 2

    the DOS-like Multi-user Operating System (MOS). I remember seeing it run on a 386/25. You could shadow users' Wordperfect actions, or stay in yer own. A DOS based terminal server. Was nice. -Steve

    --
    My intelligence insults itself.
  225. Another Helpful link by jhughes · · Score: 1

    If you can't figure out all the codes, here's a link that'll help out the newbies (like me)

    http://www.linuxhelp.net/guides/xted/bashprompt. ph tml

  226. super prompt! by dave-fu · · Score: 1

    prompt $d $t $_$p$g

    --
    Easy does it!
    This comment has been submitted already, 276865 hours , 59 minutes ago. No need to try again.
  227. Color coded full line by nahdude812 · · Score: 1

    export PS1="(\# \[\033[0;31m\]\u@\h \[\033[0;34;1m\]\w\[\033[0;37m\])\n> "

    looks like this: (with <COLOR> indicating its color, DUH)
    <Normal>(46 <RED>mightye@tux <BLUE>/var/log<Normal>)
    >

  228. How to freak out a Windows user by gblues · · Score: 1

    Use the following steps to really, really confuse a Windows user (it's particularly effective if they have a Linux dual-boot):

    First, open MSDOS.SYS in notepad. Under [Options] add the line "Logo=0" (no quotes. and that's a zero, not a captial 'o'). Also change the BootGUI line to "BootGUI=0" and then save the file.

    Next, create a text file called "greeting.txt" and make it look like the login banner for a Linux box. If you want to get really fancy, make several files that, when concatenated, closely resemble the Linux kernel boot process.

    Now the fun begins.

    Edit the autoexec.bat and REM out any existing lines. Then put the following at the top:

    @ECHO OFF
    CLS
    TYPE C:\GREETING.TXT
    PROMPT Login:

    Note: put a space after the colon on the PROMPT line.

    Save the file and wait for him to reboot. Or, if you want to go the full linux boot route, insert a "dir /s c:\windows\system >nul" between "type" commands. Not only will this put an adequate pause between files, but it will also generate a bit of disk activity to make the fake boot all the more convincing!

    Nathan

  229. For the good old sake by chrisdb · · Score: 1

    Many others have summitted it by fun, but I have actually used prompt below for years now. Many of my friends are shocked as the lean over my shoulders to read my commands. It's fun though ... I don't even think about it anymore ... ;-) PS1='c:\w\>' c:~\> c:~\>cd data c:~/data/> Chris

  230. Re:Oh Yeah by tconnors · · Score: 1

    he he, just gotta do this:

    PS1="All your \w are belong to \h>"

  231. umm hummm by Rogain · · Score: 1

    Yep on a recent conference call I overheard,"ok I've rebooted the ss7 server..." "..uh wait..shit.. I think you rebooted the wrong one!!" We were doing a software upgrade on 1 of 2 clusters. The 2nd cluster had all traffic routed to it during the upgrade of cluster 1, until he rebooted cluster2-ss7 that is........

    He had logged into to both ss7 servers because he wanted to monitor cluster2 closely while cluster1 was down, and he got the windows mixed up. A large telco that will remain nameless stoped processing a certain type of calls for about 25 minutes.

    --
    The current Slashdot moderation system is made by gay communists!
  232. crap by Rogain · · Score: 1

    But I also meant stuff other than the prompt too. I always add cal, and code to catch when I'm loging in from a windows box, that is a special case as their terminal emulator suck so bad.

    --
    The current Slashdot moderation system is made by gay communists!
  233. unix CP/M by Rogain · · Score: 1

    I always do the opposite to anger the IT guys. They get really pissed because for a few seconds they think I installed linux or x86 solaris on another one of their machines. Microsoft Weenies.

    --
    The current Slashdot moderation system is made by gay communists!
  234. Yours looks EASY by blakestah · · Score: 3

    Try this one. Use color !

    export PS1='\[\e[0;31m\]\u\[\e[1;37m\]@\[\e[0;37m\]\h\[\e [0;36m\](\W)\[\e[0;0m\]$ '

    1. Re:Yours looks EASY by carlos_benj · · Score: 1
      Using colors on the shell is quite useful if you telnet/ssh into other boxes. That way you can easily spot what computer you're working on and not screw up on the wrong computer :).

      That's why I only screw up on the right computer....

      --

      --

      As a matter of fact, I am a lawyer. But I play an actor on TV.

    2. Re:Yours looks EASY by Drone-X · · Score: 5
      Color?? Excuse me for breathing, but I'm using a paper teletype and MAN it's hard enough to use Lynx on this thing without all the frilly escape codes.
      Using colors on the shell is quite useful if you telnet/ssh into other boxes. That way you can easily spot what computer you're working on and not screw up on the wrong computer :).
    3. Re:Yours looks EASY by CaptainZapp · · Score: 5
      Using colors on the shell is quite useful if you telnet/ssh into other boxes. That way you can easily spot what computer you're working on and not screw up on the wrong computer :).

      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

      --
      ich bin der musikant

      mit taschenrechner in der hand

      kraftwerk

  235. cheap copy by Kernel+Panic · · Score: 1

    I liked the colors for one I saw here, but the blue is impossible to read with shaded transparent eterms. So here is my alteration to make it easy to read for me:

    PS1='\[\e[1;30m\][\[\e[4;33m\]\t\[\e[1;30m\]]-[\e[ 0;34m\]\d\[\e[1;30m\]]-[\e[0;34m\]\[\e[1;31m\]\w\[ \e[1;30m\]]\n\[\e[1;30m\][\[\e[0;32m\]\u@\h\[\e[1; 30m\]]\[\e[0;0m\] '

    --
    No datacenter is secure if it has windows.
  236. Counterexample by polymath69 · · Score: 1
    You can't affect a parent shell from a subshell in any way that I am aware of.
    $ bash
    $ kill -9 $PPID

    Is that "no affect"? Or did you mean () subshells? From those, $$ should work.

    --

    --

    --
    I don't want to rule the world... I just want to be in charge of mayonnaise.
  237. A myriad by polymath69 · · Score: 2
    In color xterms, I use
    PS1="\[\e[1;36m\](\[\e[1;33m\]\u\[\e[1;31m\]@\[\e[ 1;33m\]\h"
    PS1="${PS1}\[\e[1;36m\e]2;xterm: \w\007\])\$\[\e[1;32m\] "
    PS2="\[\e[1;36m\]>\[\e[1;32m\] "

    In vanilla xterms,

    PS1="(\u@\h)\[\e]2;xterm: \w\007\]\\$ "

    For other term types:

    PS1="(\h)[\w]\\$ "

    On my DOS box, of course, it's different;

    prompt=$e[s$e[44;37;1m$e[1;1H $d %_time Directory $P$e[K$e[1;62H Shell $z %@do smem[K]K free$e[K$e[0m$e[u$e[1;33m$ Then I said, "$e[36m


    --
    --

    --
    I don't want to rule the world... I just want to be in charge of mayonnaise.
    1. Re:A myriad by Bahamuto · · Score: 1

      Oh man you have the BEEP in there. That brings back some memories. We had to create our own shell in one of my c++ classes. To be anoying I made it so it would beep everytime you entered a command... and then I made it so it would beep whenever you typed in a character. The first time I tested it though I created an infinite loop od beeps and crashed the solaris machine I was working on... and I thought those things were uncrashable...

      PC Load letter

  238. Re:exit codes by ahde · · Score: 1

    hey, that's a good idea

  239. change xterm colors by jptxs · · Score: 1

    in my .bash_profile i change colors for different users: xtermset -fg "White" -bg "DarkBlue", and I change them back via my .bash_logout. That gives me a real clue what I'm doing real quick. But I use a boring prompt:

    if test "$UID" = 0; then
    PS1='%n@%m:%~ # '
    else
    PS1='%n@%m:%~ > '
    fi

    --
    we speak the way we breathe --Fugazi
  240. Use the xterm, Luke! by TaleSpinner · · Score: 1
    From my .bashrc:

    export PS1='^[]0;`hostname -s`:`pwd`^G> '

    where ^[ is "ctrl-v esc" and ^G is "ctrl-v ctrl-g".

    This gives just:

    > _

    On the command line, but it puts the hostname and current directory in the titlebar.

  241. My prompt... by TheCarp · · Score: 1

    Well in bash I use this:
    [sjc@brake sjc]$ echo $PS1
    [\u@\h \W]\$ \[\033]0;\u@\h \w\007\]

    Pretty simple... takes who and where I am, and sends the info to my terminal windo so it can set the title bar apropriatly.

    Of course, my terminal windows don't have title bars (or even boarders), but it does make the window list work a bit better ;)

    -Steve

    --
    "I opened my eyes, and everything went dark again"
    1. Re:My prompt... by Gordonjcp · · Score: 1
      OK, I'll bite...

      Click here then hit space. Not goatsecx, I promise...

    2. Re:My prompt... by deaddrunk · · Score: 1

      Most of the kids here wouldn't get that reference, but good one anyway :-)

      --
      Does a Christian soccer team even need a goalkeeper?
  242. My Phone by Xenex · · Score: 5
    The logo on my mobile phone (a Nokia 6210) is

    [root@6210 /]#

    :-)

  243. simple... by spader · · Score: 1

    [\u@\h|\T|\w|{\#}]$

  244. Re:2 liner, if your into that sort of thing... by 4of12 · · Score: 2

    Yeah, I like brevity, but I have a 2 liner.

    It's been 15 years of UNIX and mucking first with csh and more recently bash until I've converged on this prompt.

    PS1="[${green}\h ${cyan}\w${white}]\n\t ${yellow}\! ${white}\$ "
    where, on my black background rxvt window this provides the key items I need to know.

    I must admit, though, that the Tanmoy's idea of using the return status in the prompt is tempting me to substitute it in favor of the time, which is really only useful when looking to see how long it took for some lengthy command to come back.

    Anyone remember the reasons for the enclosing brackets? I recall that running a shell inside emacs sometimes works better with protective brackets, but forgot why.

    P.S. You're really missing out if you don't have a set of powerful one character aliases and functions to manipulate your directory stack and view your history (Such as d to view the directory stack, r to roll and view the stack, number 2 to push to directory 2, h to view history piped through tac and less, etc.)!

    --
    "Provided by the management for your protection."
  245. Re:My favorite for bash by Atzanteol · · Score: 1

    Now *that* is cruel!

    I hope nobody runs this...

    --
    "Ignorance more frequently begets confidence than does knowledge"

    - Charles Darwin
  246. Re:my net worth on the command line by bill_kress · · Score: 1

    I'm so depressed at my "Net Worth" over the last year that I can't even bring up MyYahoo any more. If I put it on my command prompt, I'd probably end up killing myself.

  247. Re:prompt good prompt by pauldy · · Score: 1

    For those who want to play with this I found the following in some notes I had taken long ago. I use it to add color and effects to shell programs I write but it works just as well with the shell prompt. I use a format similar to the poster above.
    I'm not sure which is the "more correct" way to do it but mine seems to work fine where I use it.

    PS1="\033[34;47;1m[\033[30m\t\033[34m] \033[34m[\033[31m\u\033[34m@\033[35m\h\033[34m:\03 3[33m\w\033[34m]\033[0;1;32;40m # "

    0 All attributes off
    1 Bold on
    4 Underscore
    5 Blink on
    7 Reverse video on
    8 Concealed on
    30 Black
    31 Red
    32 Green
    33 Yellow
    34 Blue
    35 Magenta
    36 Cyan
    37 White
    40 Black
    41 Red
    42 Green
    43 Yellow
    44 Blue
    45 Magenta
    46 Cyan
    47 White

  248. prompt by daevt · · Score: 1

    [\t][\h][\w] [time][host][directory]

  249. Quit logging in as root by StanSmith · · Score: 1
    You should really be logging in as an unprivileged account and su'ing up.

    Martin

  250. Simple, un-stupid. by Torke · · Score: 2

    export PS1="(\u@\h) [\w]\\$ " -- Torke http://anarchy.ca

  251. My UNIX prompt really does look like that.. by Tom7 · · Score: 2

    declare -x PS1="C:\\\\\W> "

    ... just to amuse me and confuse onlookers. =)

  252. tcsh prompt by goodwid · · Score: 1

    Since I'm a screen user, I use this:
    set prompt="%{^[[1;32m%}%m%{^[[0;39m%} [%d %D%w%Y] %T %c %h%# %L"

    if ($?WINDOW) then
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspset prompt="$WINDOW-$prompt"
    which translates to this:
    falcon [Fri 06Jul2001] 9:51 ~ 488>
    (with a green hostname, of course)

    On different hosts, the hostname is a different color..

    --

    The net interprets censorship as damage and routes around it. -- John Gilmore
  253. Linus Torvalds practical Joke by Laven · · Score: 2
    (from Lars Wirzenius, a friend of Linus Torvalds)

    "Once, when Linus was abroad at some conference or another, he modified my shell setup scripts so that when I logged in, it looked as if I was using MS-DOS. That was fun, of course, but it begged for revenge. This happened while we were sharing an office at the university, so once when Linus went out to get something to drink or something, I created an alias for startx for him. My alias first ran the real startx, and then printed out a kernel `Oops' message. The first time Linus noticed this made him a bit worried, but he logged out and cleared the screen too fast to read it, but the second time made him really worried. I'd copied the `Oops' message from linux-kernel, and of course it didn't suit Linus's kernel at all. He had gotten as far as decoding the message by hand, and muttering something like ``Why is it crashing there? It can't crash there!'', when I burst out laughing and told him what I'd done. Linus what quite relieved and never tried any practical jokes on me again."

  254. I keep mine nice and boring by 11thangel · · Score: 1

    I'm using an Eterm 99% of the time, and the nice pretty bg on that keeps my eyes occupied enough for a dull old [root@net /root]# to keep me happy.

    --

    I am !amused.
    1. Re:I keep mine nice and boring by vicviper · · Score: 1

      hmmm, pr0n prompt eh? hmmm images of ascii pr0n comes to mind....

  255. KSH Prompt? by Cheshire+Cat · · Score: 1

    As much as I hate to admit I cannot figure this out, how do I put my current directory in my prompt, in KSH?

    --

    Last night I shot an elephant in my pajamas. How he got in my pajamas I'll never know.
    1. Re:KSH Prompt? by uigrad_2000 · · Score: 1
      Easy.

      export PS1="${PWD}# "

      will work fine. I like color, so I use:
      typeset -x BLACK='^[[30m'
      typeset -x RED='^[[31m'
      typeset -x GREEN='^[[32m'
      typeset -x YELLOW='^[[33m'
      typeset -x BLUE='^[[34m'
      typeset -x MAGENTA='^[[35m'
      typeset -x CYAN='^[[36m'
      typeset -x WHITE='^[[37m'
      typeset -x BOLD='^[[1m'
      typeset PS1='${RED}${BOLD}${PWD}
      ${BOLD}${YELLOW}[${CYAN}$?${YELLOW}:${CYAN}!${YELL OW}]^[[0m# '

      (of course ^[ is an escape. Press "<cntr-v><esc>" in vi to enter an escape.)

      --
      Free unix account: freeshell.org
    2. Re:KSH Prompt? by Amazing+Quantum+Man · · Score: 2

      PS1='${Hi} ${Norm}$Host:$PWD

      PS2='${Hi} Sammy! How about a beer!'

      --
      Fascism starts when the efficiency of the government becomes more important than the rights of the people.
  256. Thanks! by Cheshire+Cat · · Score: 1

    Thanks to everyone who helped me out. I got it now! :)

    --

    Last night I shot an elephant in my pajamas. How he got in my pajamas I'll never know.
  257. Themeable bash prompt! by Vulture_ · · Score: 1

    color="32"
    normal="\033[0;${color}m"
    bold="\033[1;${color}m"
    off="\033[0m"
    export PS1="$normal\332\304\304$bold($normal\s$bold/$norm al\V$bold)$normal\304$bold($normal\`date +\"%a %B %-d %l:%M%P\"\`$bold)$normal\304$bold($normal\u$bold@$ normal\h$bold)$normal\304\304\n\300\304$bold[$norm al\w$bold]$off "

    There you go. I just got inspired by this article and decided to make up a new one based on user #1268's 'leet prompt.

    This one's nice and themeable -- just change the `color' variable to change the color scheme. I like it green like that, but...

    --

    The only way the typical /.er can pick up a chick is with a forklift. -- AC

  258. Re:DOS Format C? by martinflack · · Score: 1

    Back in middle school we once set the prompt on our computer teacher's main server to:

    C:\>echo Y | format C:

    Man... he was pissed. :-)

  259. Here's mine by Krellan · · Score: 1

    Here's mine. Been using it since around 1994 or so. I've copied it to pretty much every machine I've used since then.

    I use tcsh! (Keep the flames to yourself, I still program in bash but prefer tcsh for interactive use)

    set prompt="[%n@%m %l] {${shlvl} %h} %B%T%b (%?) %B%~%#%b "

    This looks like this:

    [krellan@mybox pts/9] {1 84} 11:52 (0) ~/mydir>

    This tells me my username, the machine I am on, and the terminal I'm using (handy for write(1) or for distinguishing between multiple windows).

    It also tells me the shell level (so I know if typing exit will log me off or simply leave a subshell), and the history number of this command. I also get the time of day and the exit code of the previous command. Finally, there's the directory (of course).

    It looks complicated but I have a use for everything in it. It is fast, because no external programs are executed. The time and directory are in boldface, to stand out.

    The only problem is that it takes up too much space if the directory is really long....


    Super eurobeat from Avex and Konami unite in your DANCE!
  260. Re:DOS Format C? by Dracos · · Score: 1

    I also enjoy changing the screen colors (including cursor color) so that text becomes invisible. For more fun, I make the prompt visible.

    Sort of off topic, but I once added "autoexec.bat" to the end of said file on a friend of mine's DOS machine. It took him:

    1. 15 minutes to figure outhe had to turn the thing off
    2. Another 30 minutes to find a boot floppy

    I laughed my arse off watching him and claiming I didn't know what was going on. Granted, this was some years ago. The machine was a Packard Bell 386/40 (he deserved it just for using the thing).




    Dracos
  261. Re:Blue Screen of Death (in DOS) by Trepalium · · Score: 1

    That would be a cross linked cluster. FAT is infamous for causing that when the FATs only get partially updated. chkdsk/scandisk are usually able to fix them without much data loss. The only FAT corruption problem more common than crosslinks were "lost clusters" (allocated but unassigned clusters).

    --
    I used up all my sick days, so I'm calling in dead.
  262. Re:Blue Screen of Death (in DOS) by Trepalium · · Score: 1
    I remember Ctrl-P hanging the kernel in an IO problem loop[...]
    What on earth are you talking about? Ctrl-P turned on printer echo, and the reason it hangs most systems was the fact that the printer was usually either off or there was no printer, so DOS was waiting for the printer to signal it was ready to receive. However, most versions of DOS would eventually timeout the operation if you waited long enough (or had print.exe loaded resident). Your system wasn't hung, it was busy-waiting.
    --
    I used up all my sick days, so I'm calling in dead.
  263. .profile? by Elmindreda+Farshaw · · Score: 1

    nah, but my .cshrc produces this fancy prompt:

    >

    and I've never had reason to change it. pwd, id, date and all the others are there when I need them.

  264. My cool prompt by OdinHuntr · · Score: 2

    GRAY="\[\033[1;30m\]"
    BLUE="\[\033[0;34m\]"
    GREEN="\[\033[0;32m\]"
    CYAN="\[\033[0;36m\]"
    RED="\[\033[0;31m\]"
    PURPLE="\[\033[0;35m\]"
    BROWN="\[\033[0;33m\]"
    LTGRAY="\[\033[0;37m\]"
    LTBLUE="\[\033[1;34m\]"
    LTGREEN="\[\033[1;32m\]"
    LTCYAN="\[\033[1;36m\]"
    LTRED="\[\033[1;31m\]"
    LTPURPLE="\[\033[1;35m\]"
    YELLOW="\[\033[1;33m\]"
    WHITE="\[\033[1;37m\]"

    PS1="\n${TITLEBAR}\
    $LTCYAN($CYAN\$(date +%H):\$(date +%M)$LTCYAN)-\
    ($LTRED\u@\h$LTCYAN)-\
    ($LTRED\$(lsbytes) MB$LTCYAN)-\
    ($LTRED\$(ls | wc -l | bc) files$LTCYAN)\n\
    [ $LTRED\w$LTCYAN ]\
    $LTGRAY > "

    lsbytes is a poorly named shell script that outputs a MB count of files in the current directory.

    The whole mess looks like this:
    (14:51)-(erik@mjollnir)-(98.79 MB)-(21 files)
    [ ~ ] > xemacs

    With colors added, of course.


    --
    odinhuntr

  265. if your prompt looks like.... by krokodil · · Score: 5

    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.

    1. Re:if your prompt looks like.... by Fesh · · Score: 2
      8. Yessir? You've got a definite inferiority complex.

      Sadly, this was my prompt on the Sun box in college for a while...


      --Fesh

      --
      --Fesh
      Kill -9 'em all, let root@localhost sort 'em out.
    2. Re:if your prompt looks like.... by Andux · · Score: 1
      9. O Great One, what is your wish?

      You have an ego the size of France.

      10: Eh?

      Blame Canada!

      11: cat css_descramble.c

      Nice, but isn't that a bit long?

      12: cat efdtt.c

      Much better.

      --
      (Do not sign anything.) -- Fell, Planescape: Torment
    3. Re:if your prompt looks like.... by sofar · · Score: 2


      Well,

      6. Yomama#

      You are in desperate need of help, think about professional guidance.

      (after SuSE rescue images... ;-)

  266. Re:Moderation Totals:Redundant=1, Funny=8, Overrat by AsbestosRush · · Score: 1

    @comments = "flat", "newest_first";

    --
    EveryDNS. Use it. It works.
    AC's need not reply
  267. Re:this is just absurd by AsbestosRush · · Score: 1

    I'd recommend everyone learning either C or asm as a first language; it makes you understand the computer, and how things work.
    C or ASM? does anyone else think that someone should learn to learn proper programming style on a higher-level language first, then move closer to the machine?
    Don't get me wrong, I'm all for people learning lower level code, but basics (such as logic, error catching, etc.) would be more easily taught and focused on with higher level languages such as Python, Java, or PERL.

    --
    EveryDNS. Use it. It works.
    AC's need not reply
  268. Fun prompts by Richy_T · · Score: 2
    At universtity, they ran a PAD system and to connect to your desired host, you had to type the name of the machine at the pad prompt (went something like PADDCA112>) before you could log on. So I changed my prompt to be the same as a PAD prompt.

    I never used it for evil but it was quite amusing one time when a "know it all" decided he just had to show me something so barged me out of the way and then sat there confused wondering why he couldn't connect to a machine and kept getting "command not found" type errors

    Rich

    1. Re:Fun prompts by Quixotic+Raindrop · · Score: 1

      tcsh: set prompt = " ---- %M | %/ ---- \ myuser > " displays a two line prompt: ---- Full.Host.NAME | /full/dir/loc ---- myuser > it makes it a lot easier to use than a command prompt which expands and contracts with the directory location in it, and really helps when I shell into other boxes, to keep track of which box I'm currently talking to!

      --
      Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. (Einstein)
    2. Re:Fun prompts by Quixotic+Raindrop · · Score: 1

      Let's make this readable


      set prompt = " ---- %M | %/ ---- \

      myuser > "


      which displays:


      ---- Full.Host.NAME | /full/dir/path ----

      myuser >

      --
      Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. (Einstein)
  269. I adore my 64... by Robber+Baron · · Score: 1

    Ready
    _ (flashing rectangle here)

    --

    You're using her as bait, Master!

  270. random prompt by dezwart · · Score: 2

    PS1=`cat /dev/urandom`

  271. more than just PS1 by chris_calabrese · · Score: 1

    # set PS1 with system name, the history # number (ksh) and last bit of the current # directory (truncated so it won't be # too long to fit on the screen. Format # the whole thing as vbl=value; so that cut # and paste works export SYSNAME=`uname -n` export PS1='$SYSNAME=!_${PWD#${PWD%/*/*/*}/}; ' # Set PS2 to be cut and paste friendly export PS2=' ' # Set window titles if xterm or dtterm and # change PS1 to be more streamlined (since # other info in window title) case "$TERM" in xterm|dtterm) export startHeader="$(print '\033]2; ')" export endHeader="$(print ' \007\c')" export startIcon="$(print '\033]1;')" export endIcon="$(print '\007\c')" PS1='${startHeader}$LOGNAME@$SYSNAME: ${PWD#${PWD%/*/*/*/*}/}${endHeader }${startIcon}$LOGNAME@$SYSNAME${endIcon}^M$SYSNAME =!; ' esac

    1. Re:more than just PS1 by chris_calabrese · · Score: 1
      Oops, let me reformat that a bit...

      # set PS1 with system name, the history
      # number (ksh) and last bit of the current
      # directory (truncated so it won't be
      # too long to fit on the screen. Format
      # the whole thing as vbl=value; so that cut
      # and paste works export SYSNAME=`uname -n` export PS1='$SYSNAME=!_${PWD#${PWD%/*/*/*}/}; '

      # Set PS2 to be cut and paste friendly export PS2=' '

      # Set window titles if xterm or dtterm and
      # change PS1 to be more streamlined (since
      # other info in window title)
      case "$TERM" in
      xterm|dtterm)
      export startHeader="$(print '\033]2; ')"
      export endHeader="$(print ' \007\c')"
      export startIcon="$(print '\033]1;')"
      export endIcon="$(print '\007\c')"
      PS1='${startHeader}$LOGNAME@$SYSNAME: ${PWD#${PWD%/*/*/*/*}/}${endHeader}${startIcon}$LO GNAME@$SYSNAME${endIcon}^M$SYSNAME =!; '
      esac

  272. A little bit of bash color. by segoave · · Score: 1

    PS1="\[\033[1;33m\]\# \h:\W>\[\033[0m\]"

    Also truncates the path.

  273. xterm Escape Sequences by onetruedabe · · Score: 1
    xterm and Eterm allow you to change their title and icon strings via escape sequences:
    if [ "$TERM" = xterm ]; then
    export PS1="\[\033]2;\u@\h \w\007\033]1;\h\007\]\u@\h:\w> "
    else
    export PS1="\u@\h:\w> "
    fi

    I actually do a lot more, like putting "jobs | grep -c Stopped" in curly braces at the beginning,
    and if I'm running under "screen" I put the $STY variable in square brackets, and if I'm root
    I change the ">" to a "#", etc.

    For my be-all end-all .bashrc (hopefully this will be informative), check out:

    http://www.dabe.com/bashrc

    --
    Dabe

  274. heehee by SaiyajinTrunks · · Score: 1

    Just the other day, I was explaining to someone (who had never used a computer before Win95) how you could do fun things with DOS and ansi.sys like re-map 'n' to 'y' and some other key to 'format c:' or just re-map all keys to 'echo y|format c:' and laugh! Ahh how I pine for the old BBS glory days.

    To get even further off-topic...one time I broke into some BBS (sysop was a real asshole) by raw-ascii uploading my command.com and io.sys. He tried to break into chat soon after I started u/l-ing, but that's when he caught a nasty control sequence that gave me a prompt! Fun stuff.

    --


    "You point your finger at the moon, the fool stares at your finger."
  275. Can't seem to make up my mind by mikewas · · Score: 1

    Here's part of my .profile: # export PS1=$SESSION_SVR':$PWD'"$ " # export PS1='$SESSION_SVR'" $ " # export PS1='$LOGNAME'"$ " # export PS1='$SESSION_SVR':'$LOGNAME'"$ " export PS1=`tput smso``hostname`':$PWD'`tput rmso`" $ " One of these days maybe I'll get it right?!

    --

    "Glory is fleeting, but obscurity is forever." --Napoleon Bonaparte
  276. Re:The one I see most often... by Vaer · · Score: 1

    All the freebsd machines in our cisco lab now have 'en', 'ena' aliased to 'su', as a couple of us kept tapping in 'en' whenever we needed to get into a privilaged state. They have a rather simple and elegant prompt for tcsh that one of my coworkers found somewhere:
    set prompt = "%B%m:%b%~%B%#%b "
    Looks like this when logged in as root:
    hostname:~#

  277. Re:Only a geek by mr_gerbik · · Score: 2

    Thats funny.. mine was kind of similar, it usually was some variation of the following:

    I'm sorry, I do not know how to "fuck myself".
    (exits: N,S,E)
    >

  278. heres mine simple and sweet two liner by anonimato · · Score: 1

    PS1="[\[\033[1;34m\] \w \033[1;37m\]] \n \u@\h>"

    --
    -=[the machine masters the grim and the dumb]=-
  279. My DOS command prompt by basscomm · · Score: 1

    prompt $d$t$p$g

    --
    http://crummysocks.com
  280. Re:What prompt? by SuiteSisterMary · · Score: 2

    I know you're just being an idiot, but start->run and type 'cmd'.

    --
    Vintage computer games and RPG books available. Email me if you're interested.
  281. two line prompt by jaydub2001 · · Score: 1

    after already defining colors....

    PS1="\[$LBLU\](\[$LRED\]*\[$LYEL\]\h\[$LRED\]*\[$L BLU\])\[$WHT\]--\[$LBLU\](\[$LGRN\]\u\[$LBLU\])\[$ WHT\]--\[$LBLU\](\[$LCYN\]\w\[$LBLU\])

    see it here:

    http://www.triptonite.com/~jaydub/bash.jpg

  282. Reminds me of 3|33t DOS hackerz by RevAaron · · Score: 2
    Heh. I remember people used to have ANSI fancy-pants command prompts in DOS. Why, if you didn't have something aside $p$g, you were totally l4m3, and definately not a k-rad hacker.

    Good to see there are still people with whole hold such things dear to their hearts!

    --

    Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  283. My zsh prompt by dagbrown · · Score: 1

    if [[ -o interactive ]]; then
    PS1="%{$(tput sc)$(tput cup 0 $[COLUMNS-9])%D{%H:%M:%S}$(tput rc)%}%(?,:),:() %B[%(4.;.../%3.;%3.)]%b%(#.#.) "
    cl="$(tput sc)$(tput cup 0 $[COLUMNS-9])"
    ecl="$(tput rc)"
    trap 'print -Pn "${cl}%D{%H:%M:%S}${ecl}"' ALRM
    TMOUT=1
    fi

    Serves my purposes well enough. Spot the Clever ZSH-Specific Tricks. Spot the tricks which don't depend on zsh.

    --Dave

  284. Poor Spot... by AnarchoFreak_00 · · Score: 1

    C:\>

    C:\>cd spot

    Bad command or file name

    C:\>

    Looks like spot didn't run fast enough.

  285. Is it just me... by R.Caley · · Score: 1
    Given colour prompts are common, I presume everyone lese has managed to persuade bash not to screw up when the line wrappes because it doesn't understand escapes in the prompt...

    Go-on, give an old bloke a clue...
    _O_

    --
    _O_
    .|<
    The named which can be named is not the true named
  286. Re:Oh Yeah by jbarnett · · Score: 2


    Mmm radius.

    It also helps to set the title bar on your terminal program (teraterm/xterm/Eterm) to

    "All your base are belong to $HOSTNAME"

    Just glance up quickly to determine which machine you are on.


    --

    "`Ford, you're turning into a penguin. Stop it.'" -THHGTTG
  287. Yea by jbarnett · · Score: 2

    What Does Your Command Prompt Look Like?

    I will show you mine if you show me yours!

    OR

    Show me your prompts!

    OR

    All your bash are belong to us.


    --

    "`Ford, you're turning into a penguin. Stop it.'" -THHGTTG
  288. prompt by timbu2 · · Score: 1

    set prompt="`uname -n` | `whoami` [\!]: >" Which looks like the following in csh. maple:/home/timbu | timbu [13]: >

  289. Re:my net worth on the command line by Rei · · Score: 2

    As is quite evidenced by your post :)

    -= rei =-

    --
    "This may be presumptuous..." "That's my favorite kind of 'This'."
  290. Re:2 liner, if your into that sort of thing... by ahknight · · Score: 2
    Nifty, but here's neato, for a 2 liner:

    #!/bin/bash
    SC=\\[\\033[1\;36m\\]

    RESET=\\[\\033[0m\\]
    RED=\\[\\033[0\;31m\\]
    GREEN=\\[\\033[1\;32m\\]
    YELLOW=\\[\\033[1\;33m\\]
    DKYELLOW=\\[\\033[0\;33m\\]
    CYAN=\\[\\033[1\;36m\\]
    DKCYAN=\\[\\033[0\;36m\\]
    WHITE=\\[\\033[0\;37m\\]

    MYPROCS=$(ps -fu ahknight | wc | awk '{print $1-4}')
    LOAD=$(uptime | cut -d"g" -f2|cut -c3-)
    WHO=$(who|wc|awk '{print $1}')
    export PS1="$GREEN[ $RED\d \@ $DKCYAN\w $DKYELLOW$LOAD $CYAN[$GREEN$MYPROCS$CYAN] [$GREEN$WHO$CYAN] $GREEN]$RESET\n\ $GREEN[$SC \u$YELLOW@$SC\h $GREEN]$RESET $ $WHITE"

    Which looks like:

    [ Fri Jul 6 12:03pm ~ 1.46, 1.37, 1.39 [1] [1] ]
    [ ahknight@hostname ] $

    All kinds of handy, but it does turn a cat on the enter key into a minor DOS attack. ;)

  291. Back in the DOS days... by Aryeh+Goretsky · · Score: 1

    Hello,

    At the first company I worked at, my coworkers and I would take turns visiting each other's computer when not around, and type in the following lines:

    MODE 40,25
    SET PROMPT=SYSTEM HALTED$_NO ROM BASIC.$_
    CLS

    Since the systems we were using were generally junk, one was never sure if it was a legitimate message or not. In case you're wondering, that set the screen to double-wide text, and was the same error message our PC's showed when they couldn't find any hard disks or floppy drives to boot from.

    Later on, one of the programmers gave me a cool prompt:

    SET PROMPT=$e[37;44m$e[s$e[1;50H $d $T$h$h$h$h$h$h$e[u$e[37;40m$p$g

    Obviously, an ANSI console driver was required to maximize viewing pleasure. I used XANSI.SYS myself. (Thank you, Jivko, wherever you are.)

    When Windows began to usurp DOS as the OS of choice at the office, I learned about WINPMT and put the following in my AUTOEXEC.BAT file:

    SET WINPMT=$P

    This gave me an easy way to see if I was in real, honest-to-goodness DOS, or shelled out from inside of Windows. (That's Alt+0187, in case you weren't sure.)

    Well, anyways, that's all I can remember for now. I'm sorry I don't have any exciting *sh prompts to share, but I'm still learning Linux. *grin*

    Regards,

    Aryeh Goretsky

    - - -

    --
    Dexter is a good dog.
  292. Re:DOS Format C? by prog-guru · · Score: 1

    There's the BSOD one with the xscreensaver deb package. It flashes panics from different OS's (windows BSOD, NT BSOD, oops, sad macintosh, etc).

    --

    chris@xanadu:~$ whatis /.
    /.: nothing appropriate.

  293. Re:Prompness... by prog-guru · · Score: 1

    I try do avoid `executing anything` in PS1. If your DNS is broken, and you have something like `whoami`@`hostname -s` in your prompt it will slow you down. \h isn't too bad, where I can't use that I set hostname -s to a variable once then call it later in PS1 or PROMPT_COMMAND (xterm title). The only thing I execute for each prompt is `whoami` so it's accurate after I su -m root.

    --

    chris@xanadu:~$ whatis /.
    /.: nothing appropriate.

  294. Wrong... by Shin+Elendale · · Score: 1
    Real geeks use the ITS debugger as their command prompt. :')

    Real geeks don't need to debug.

    -Elendale
    --

    IANAT (I Am Not A Troll)

  295. Huh? It can be very useful by JiveDonut · · Score: 1

    If you log into a lot of boxes having a good command prompt can make a big difference. A different color or having the hostname in the prompt can prevent making a silly mistake.

  296. Re:Mine: Lots of info, lots of colors. Link to cod by enneff · · Score: 1

    "STOP POKING ME!!!!" -- Protoss Observer, Starcraft

    That first appeared in Warcraft, the original. It's been a running joke in Blizzard games ever since.


  297. is this an e2 GTKY node? it must be. by characterZer0 · · Score: 1

    what the heck, here it is:

    PS1='\@[\w]\$ '

    where am I?
    when am I?
    all i need to know.

    --
    Go green: turn off your refrigerator.
  298. The prompt from the black lagoon by Theodore+Logan · · Score: 1

    I'll gladly admit that I didn't come up with this one myself, but it is kinda sweet. The author says he wouldn't recommend using it on anything less than a P400 (on which it still "results in noticeable delays in the appearance of the prompt"). If that's not hardcore enough, count me out...

    --

    "If you think education is expensive, try ignorance" - Derek Bok

  299. prompt too long? by The+Pim · · Score: 2
    My otherwise boring prompt uses a nifty zsh feature to keep the line from getting too long.

    %m %n %30<..<%~%#

    left-truncates the path to 30 characters, with a leading ...

    --

    The evaluation of an action as 'practical' . . . depends on what it is that one wishes to practice.
  300. Here ya go... by JabXVI · · Score: 1

    Nothing fancy here:
    PS1='[\u \w]$'

  301. ibpconf.sh by Faux_Pseudo · · Score: 2

    Sorry I didn't get here sooner.
    I made a Interactive Bash Prompt config script you can get on freshmeat. Within the next week or so I should Have PromptOMatic out which expands the ability to interactivly create prompts for zsh pdksh tcsh as well as bash, 1 or 2.

  302. export PS1='\h:\w# ' by pestie · · Score: 1
    My prompt rulez. I'm 1337.

    export PS1='\h:\w# '

    Yeah! I r0x0r!

  303. prompt by muyThaiBxr · · Score: 1

    here's mine: set prompt="%m:%~:%# " it looks like this when you use it: screwdriver:~:> or as root: screwdriver:~:# or in some dir other than ur home dir: screwdriver:/usr/src/sys/i386/conf:> (tcsh)

  304. Re:Blue Screen of Death (in DOS) by Com2Kid · · Score: 1

    "It was incredibly easy to get DOS to crash"

    hehe, just rename a non-executable file to .exe and run it:)

    At least you could turn on a DOS computer and leave it running and reasonably expect that without hardware failures, it wouldn't ever break down. Not like some windows OS's that due to programming gliches actualy crash after so many months, or weeks in some cases, ickies. Or days if your talking Windows95OSR1

  305. Informative prompt by Frank+T.+Lofaro+Jr. · · Score: 1

    PS1='\! ($?): \t: \w: \h\$ '

    Gives the history number, last exit status, time, directory, hostname and a $ for users and a # for root.

    Very useful.
    Looks like this:

    116 (0): 19:17:25: ~: pc$

    --
    Just because it CAN be done, doesn't mean it should!
  306. Kid's, don't try this at home. by binford2k · · Score: 2

    What a nice fella you are. Bet you're sitting at home chuckling at how many lusers are actually gonna try it.

    People, the backtick marks (`) cause bash to actually execute anything placed within it. In this case, it was encoded to be "rm -r ~"

    You can do echo $'\x72'$'\x6d' $'\x2d'$'\x72' $'\x7e' (notice, no backticks in there) to see it for yourselves.

    -b

  307. Re:WARNING: read this first before you cut'n'paste by utopist · · Score: 2
    What's going to stop someone from just putting "exit" into the commands run, thereby hosing your system?

    Nothing, but that will terminate the current shell process and thus the rest of the line will not be executed.

    # su - nobody
    $ exit; rm -rf /

    will NOT delete your entire will system. The entire idea of a secure system would be a joke if that worked.

  308. Re:Me vs. The Slashdot Filters by TheGratefulNet · · Score: 2
    same here!

    dammit slashdot, get yer filters workin or just remove them!

    the moderation system is all the filter you need (sigh).

    I gave up trying to post my .tcshrc prompt setting due to your moronic filtering scheme. the world will have to live without my prompt setting (too bad).

    --

    --

    --
    "It is now safe to switch off your computer."
  309. How about this by dante101vr2 · · Score: 3

    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**
  310. Re:2 liner, if your into that sort of thing... by Tomun · · Score: 1

    I do, but without all the color.

    export PS1='\u@\h:\w/\n\$ '

  311. Finally geek stuff! by don_carnage · · Score: 2

    PS1=\n[\u@\h:\w]\n$

    No fancy colors, just funtionality. *gasp* my ls doesn't even have colors! Oh yeah...OBSD.

    --

  312. Behold the power of zsh by uid8472 · · Score: 1

    Well, actually, thanks to /.'s lame filters, you can't behold it here. But with the magic of hyperlinking, one can see the definition for my zsh prompt, which I use pretty much everywhere now (beware the unescaped control characters). Oh, and I made a screenshot (note that the terminal and shell are on 2 different systems) to demonstrate its various properties.

    Surprisingly, some thought to actual usability went into this: the ANSI colors highlight the hostname, so I don't forget what system I'm on and blow something up; there are many blatant differences between the root and normal-user prompt ($ vs. #, coloring, privileged username in inverse video); zsh's RPROMPT parameters, which specifies text to go on the right side of the terminal window, was used to move the CWD over so that the location I type commands to doesn't change from line to line. Oh, and if a command fails, the exit status gets an eye-catching green background and is placed on the right-hand side, but separated from the CWD by a space.

    And before I switched to zsh from bash, some of the systems I was on had normal-looking prompts, but the one I first learned UNIX on, well, didn't.

  313. my friends, dirtymac's by Duckz · · Score: 1

    (dirtymac@datasync)-(Fri Jul 06,2:06pm)-(~)
    #

  314. nice prompt by Conesus · · Score: 1
    set prompt="%n@%m %S%/%s (%h)%# "

    Great for FreebSD & Linux. It uses an inverse color for the directory, shows user name, machine, and history information.

    conesus@sirius /home/conesus (206)>

    --

    Don't eat your soul to fill your belly.
    conesus.com
    1. Re:nice prompt by Conesus · · Score: 1

      Obviously, if you havem't figured it out, you would have to be in a superior shell is use this one, say /bin/tcsh. :-)

      --

      Don't eat your soul to fill your belly.
      conesus.com
  315. 2 liner, if your into that sort of thing... by galihad · · Score: 3

    NORMAL=`tput sgr0 2> /dev/null`
    BOLD=`tput bold 2> /dev/null`
    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\ h$ GREY>$NORMAL"
    PS2="$GREY>$NORMAL ";

    --
    -- galihad
    1. Re:2 liner, if your into that sort of thing... by tlizi · · Score: 2

      nice.
      here's mine

      MCLEAR=$(date +%-y.%-m.%-d.%-k.%-M.%-S)
      WHITE="\\[\\033[0;0m\\]"
      RED="\\[\\033[0;31m\\]"
      GREEN="\\[\\033[0;32m\\]"
      BLUE="\\[\\033[1;34m\\]"
      GREY="\\[\\033[1;30m\\]"
      TURQUOISE="\\[\\033[0;36m\\]"
      YELLOW="\\[\\033[1;33m\\]"
      X="x"
      C="c"

      export PS1="$YELLOW$X $RED\u $WHITE($GREEN\h$GREY,$RED\$$WHITE)$TURQUOISE:$WHIT E{$BLUE$C$GREEN\w$WHITE}$TURQUOISE:$WHITE[$BLUE@n$ GREEN$MCLEAR$WHITE]\n{ "

      export PS2="$RED{ $BLUE"

      which comes out as:

      x tlizi (ayl33,$):{c/usr/src/linux}:[@n1.7.6.18.36.6]
      {

      --
      I am not as think as you drunk I am.
  316. I like boring prompts by connorbd · · Score: 2

    I don't really screw around with my shell prompts much; the last time I did anything to a shell prompt was to get rid of a quirk in OpenBSD (something about counting upwards every time you enter a command). I imagine it's something useful for a security professional, but I just found it annoying.

    /Brian

  317. Neat KSH hack by [JP] · · Score: 1

    Here's a neat hack to make pdksh behave somewhat like tcsh %~. That is, it will display the current working directory, but with one's home directory represented by `~'.

    It will not work correctly in ksh88, though.

    TILDE='~'
    PS1=$USER@$HOST:'${TILDE[(1-0${PWD%%@([\!/]*|$HOME *)}1)]-}${PWD#$HOME}> '

  318. I thought everyone used by dmccarty · · Score: 1

    PROMPT $P$G

    --
    Have fun: Join D.N.A. (National Dyslexics Association)
  319. not functional, but fitting by JimFromJersey · · Score: 1

    }:o
    A steer getting dropped into a meat grinder feet first.....

    --
    between the greater and lesser infinities sleep the dreams undreamt
  320. tcsh w/host,dir,history, and cut-n-paste by confusedhacker · · Score: 1
    Normal user (me)

    : slurp-~/1.0/domainadmin/time[1145];

    Root user (su'd)

    : slurp-~pub/Perl/NIS-a2 #733#;

    Another user (su ftp)

    : slurp-(ftp)-~#1#;

    The leading colon and trailing semicolon allows one to cut-n-paste the entire line (most ?terms will select the whole line w/triple click) into another shell w/o probs.

  321. So, I'm boring... by DigitalSorceress · · Score: 1

    Another boring one I guess, but I just want to know what system I'm on, where I am, and whether I am root or merely mortal...

    SYSTEM=`hostname`
    PS1='[$SYSTEM]-$PWD# '

    [dev-serv]-/etc/init.d/#

    Simple and effective

    +++++++++++++++++++++

    --

    The Digital Sorceress
  322. Re:Only a geek by Morbid+Curiosity · · Score: 1
    I once saw one that said "I have no command prompt, and I must type>"

    I hope that person wasn't selling AMway... :-)

  323. Here's mine... by Guignol · · Score: 1
    export PS1=$(echo "-$TERM-[\[\e[01;31m\]\h:\[\e[01;34m\]\w\[\e[0m\]] "|/bin/sed -e "s/-xterm-/\\\[\\\e]2;\\{\\\t}[\\\!]\\\w\\\a\\\]/" |/bin/sed -e "s/^-\w*-//")
    and
    export PS1=$(echo "-$TERM-[\[\e[01;31m\]\h:\[\e[01;34m\]\w\[\e[0m\]] "|/bin/sed -e "s/-xterm-/\\\[\\\e]2;\\{\\\t}[\\\!]\\\w\\\a\\\]/" |/bin/sed -e "s/^-\w*-//")
    for root

    on my terminal, it looks like
    [vodka:~/coco] ls -l
    vodka: is yellow, red when I'm root (vodka is my machine and I rlogin a lot)
    working directory is blue
    also, if my terminal happens to be an xterm (xterm, gnome-term and Eterm),
    then the title of the term changes each times the PS1 is evaluated and looks like:
    {13:34:23}[451]~/coco/bobo
    there is probably a much better way to do it without 2 seds...
  324. *Grumpf* by Guignol · · Score: 1

    I managed to paste the root prompt twice :)
    the first 31 is of course a 33 in the first prompt :)
    oh well.. By the almighty power of copy-paste !!!

  325. escapes??? by PONA-Boy · · Score: 1

    set prompt='%{^[7^[[H^[[0;1;37;41m^[[K(%n@%m) %! %~ ^[[0;37;40m^[8^[[A^[[B%}%% '

    ...sorry, tcsh spoken here...

    sometimes a little hard on the scrollback, but very nice to trot out to newbies. *OOH, AHH*

    -PONA-

    --
    +that's funny...I don't FEEL tardy.+
  326. Sure to freak a coworker out by PoitNarf · · Score: 1

    prompt Abort, Retry, Fail?

    --

    "0101100101? It's just jibberish. *looks in mirror, gasps* 1010011010@!? AHHHHHH!!"
  327. Yes, my machine hates me. by Urungus · · Score: 1

    C>:p\

  328. mine by alisoylu · · Score: 1

    PS1="\[\033[1;34m\][\$(date +%H:%M)][\u@\h:\w]$\[\033[0m\] " export PS1 a different color for each server (blue, red, yellow etc)

  329. Prompness... by dgryn · · Score: 2

    export BOXNAME=`hostname | awk -F. '{print $1}'`
    PS1="^[[31;1m[\`date +%H:%M\` $BOXNAME] ^[[32;1m"'${PWD##*/}'"^[[0m> "

    1. Re:Prompness... by Lobachevsky · · Score: 1

      besides the special cases of using \h in bash, or hostname -s to get the hostname without the domain, in general cut -d &ltdelim&gt -f &ltN&gt is a lot better(faster & no parse time) than using awk for getting the Nth field delimeted by some delim. Just thought I'd offer that since I too was using awk -F &ltdelim&gt '{print($ &ltN&gt )}' before.

      Anata no tomodachi,
      Navin

      P.S. I was rather proud of myself for remember &amplt and &ampgt were the codes for creating less-than &lt and greater-than &gt, respectively. And as another side, I was further impressed at figuring out implicitly that &ampamp was the code to get the ampersand & when it is suffixed by what would otherwise be a code. *pats himself on the back*

  330. making it directly pasteable by heurung · · Score: 1

    Not being a pushd/popd afficionado, I copy/paste old directories often via X-selection, mainly to cd back to where I once was, so put 'cd ' in front of it to begin with, and save four whole keystrokes! I also re-use commands with triple-clicks, because of the use of the underused and usually useless ':' command. Yes, I changed my 'history' command to use ':', too.
    -------------
    export PS1='\[\e]0;$domain.\h \t \d \w\a\e[34;44;7mcd \e[34;43;1;5m\]\w;: $uname\n\[\e[35;43;1;5m\]: $?_\[\e[47m\]\t;\[\e[m\e[30;1;6m\] '
    -------------
    looks like
    -------------
    cd /home/me;: IRIX64
    : 0_17:50:03;
    -------------

    --
    Why does _everyone_ think I'm paranoid?
  331. Re:Blue Screen of Death (in DOS) by andr0meda · · Score: 1


    Consider yourself lucky, it was easy enough to generate a general protection fault. I remember Ctrl-P hanging the kernel in an IO problem loop, also floppy IO operations had their moments of 'reasonable doubt', and certainly memory managers like Qemm and PMode/W were notoriously unstable, and generated somehting comparable to NT`s BSOD. basicly anything hooked into an IRQ or BIOS was (is for me;)) able to crash your box.

    --
    With great power comes great electricity bills.
  332. Re:Blue Screen of Death (in DOS) by andr0meda · · Score: 1


    Well ok the GPF`s only showed up after EMM's turned up, and yes they don`t actually make part of D.O.S., but they were definately there.

    AS for the ctrl-p experience, you could actually reprogram your prompt to reroute keystrokes with an NDOS feature, so effectively I just turned of ctrl-p to echo the prompt and there wasn`t any risk of ctrl=p locking after that for me, ever :) That`s why I never got around to find the keycombo`s that prevented ctrl-p crashes probably.. anyway.. I was pretty fond of my dos setup, and as a matter of fact I still don`t leave my Bootdrive without one.

    --
    With great power comes great electricity bills.
  333. Re:Blue Screen of Death (in DOS) by andr0meda · · Score: 1


    Well it might have been nice to have something different from "abort/retry/fail messages" which all 3 resulted in the system pretty much being unresponsive.

    --
    With great power comes great electricity bills.
  334. Re:Mine: Lots of info, lots of colors. Link to cod by FortKnox · · Score: 1

    Use "MUD Shell". It was a slashdot quickie I believe. To move a file, you pick it up, navigate through the directory, and then drop it. Its quite an amusing shell. However, since I'm extremely lazy, I can't provide a link, but just search the /. stories for it, and you'll find it.

    --

    --
    Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
  335. who needs variables by polin8 · · Score: 1
    zsh

    PS1=$'%{\e[0;31m%}\n%{\e[1;34m%}%(2L.+.)% (3L.+.)%(4L.+.)%(5L.+.)%(6L.+.)%{\e[0;34m%}%(?..-% ?)%{\e[1;37m%}%#%{\e[0m%} '

  336. Re:WARNING: read this first before you cut'n'paste by lpontiac · · Score: 3
    What's going to stop someone from just putting "exit" into the commands run, thereby hosing your system?

    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.

  337. Funny one I'm stealing from my lecturer... by lpontiac · · Score: 4

    # (bash syntax, alter appropriately. BTW, not intended for *your* .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 .profile...
    alias rm="echo I\\'m sorry Dave, I\\'m afraid I can\\'t do that"

    1. Re:Funny one I'm stealing from my lecturer... by DA_MAN_DA_MYTH · · Score: 1

      That happened to me, (It was no one's fault but my own, Thank God for ftp)

      The worst vice is advice...

      --
      "It takes many nails to build a crib, but one screw to fill it."
  338. my net worth on the command line by bergeron76 · · Score: 3

    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.
    1. Re:my net worth on the command line by datawar · · Score: 1

      Really reminds me of the 'fuck you money' counter Avi sets up in the Cryptonomicon.

      What? You haven't read the Cryptonomicon yet? Go! Now! (It's by Neil Stephenson)

      And just to stay on topic:

      PS1="\u@\h:\w\$ "

  339. Here's one... by myov · · Score: 1

    alias exit="echo Unable to logout. Error #420567" alias logout="exit" set ignoreeof

    --
    I use Macs to up my productivity, so up yours Microsoft!
  340. My tcsh prompt by gmccon · · Score: 1

    looks like this: admin01[/home/mcconngl](3) root@admin01[/root](5) it will only show down to two directories in the prompt (the two most recent) and will show a number showing shell lvl if you go deeper in shells. id | grep -s 'uid=0(' > /dev/null if ( $status == 0 ) then set prompt = "%Broot%b@%m[%C2](\!) " else [ $SHLVL -ge 2 ] if ( $status == 0 ) then set prompt = "%m[%C3]%B|$SHLVL|%b(\!) " else set prompt = "%m[%C3](\!) " endif endif

  341. Color in ksh88 ?? by gnomer · · Score: 1

    Does anybody know how I can get different colors in my command prompt in ksh88? I tried a ksh color suggestion posted earlier but I think it must be for ksh93 because I couldn't get it to work.

    By the way here is my prompt (for ksh):
    PS1="$HOSTNAME:"'${PWD#${PWD%/*/*/*}/}'": "

    It truncates the pwd so that you only see the last three directory levels. That way your prompt won't get opressively large.

  342. Here's mine by jestapher · · Score: 1

    PS1="[\`date +%l:%M\`][\\w]\\\$" [ 2:01][/var/log]$

  343. Which command line is yours? by DA_MAN_DA_MYTH · · Score: 1

    The one that says "Bad Mother Fucker" on it

    Bad Mother Fucker$>Your/ Dam/ Right!

    The worst vice is advice...

    --
    "It takes many nails to build a crib, but one screw to fill it."
  344. My prompt is simple... but... by meatpuppy · · Score: 1

    PROMPT_COMMAND='echo -ne "\\033]2;$USER@${HOSTNAME%%.*}:${PWD//#$HOME/~}\\0 07"'

    It puts my path up on my xterm titlebars. Also has the additional benefit that the windowlist in windowmaker shows where I am and gives me clues as to what I'm doing in each window.

  345. Cascading prompt by FozzTexx · · Score: 1

    What you want to do is something like this. This is for (t)csh. Everytime you spawn another shell, your prompt will extend a little, so you can immediately tell that you're one shell deeper. That way when you exit, you won't exit too many times.

    Back when I used to admin a college lab, this was the default for all new student accounts. It worked well since part of their lab use required the use of script so they could get transcripts of their program in action.

    if( ${?prompt} ) then
    if (! $?PROMPT) setenv PROMPT
    if (`whoami` == "root") then
    setenv PROMPT ${PROMPT}\#
    else
    setenv PROMPT ${PROMPT}>
    endif

    set host=`hostname -s`
    set prompt="${host}${PROMPT} "
    fi
  346. My prompt... by Gordonjcp · · Score: 1
    ... is a flashing "K", just after the copyright message.

    48k ought to do it...

  347. cool link by RatFink100 · · Score: 1

    thanks - that'll keep me entertained for a while.

    1. Re:cool link by RatFink100 · · Score: 2

      yes - but I find that's not a bad thing

  348. Not too shabby... by Kazymyr · · Score: 2

    ...but I like a ':' before my '\w', thank you.

    --
    I hadn't known there were so many idiots in the world until I started using the Internet -Stanislaw Lem
  349. DOS Format C? by CritterNYC · · Score: 5

    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.

    1. Re:DOS Format C? by 3-State+Bit · · Score: 1

      I did better. I counted how many spaces I would need after the newline, then put "Are you sure? All information will be erased from drive C! [Y/N]:y" and then enough spaces for a newline again. "working..." The quoted part "Are you sure..." I copied verbatim (as opposed to my guess at it just now) from a format I had just tried. :) Man, good times.
      ~

    2. Re:DOS Format C? by J'raxis · · Score: 1

      PS1="[\u@\h: \w] # rm -Rf /\n"

    3. Re:DOS Format C? by J'raxis · · Score: 1

      ...I should read nested, not threaded. (I just submitted the same thing 8 hours after you.)

    4. Re:DOS Format C? by garbuck · · Score: 1

      This reminds me ... In a related vein, Windows lusers may find Mark Russinovich's BlueScreen Screen Saver highly amusing. Anyone know of an equivalent for *nix?

  350. Re:Blue Screen of Death (in DOS) by Bungie · · Score: 1

    The secret is in the order you use. If you hit abort and then fail right after, DOS will give up and give you a prompt back.

    --
    The clash of honour calls, to stand when others fall.
  351. apple II prompts by xipho · · Score: 3

    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
  352. Simple/awesome Win2k cmd prompt by bIOHZRd · · Score: 2

    %SystemRoot%\system32\cmd.exe /t:1f /k prompt $t$h$h$h$h$h$h@%computername%$_[$p]

    1. Re:Simple/awesome Win2k cmd prompt by Moghedien · · Score: 1

      Nice!

      I put "prompt $t$h$h$h$h$h$h@%computername%$_[$p]" in "HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun" to set the prompt automatically when I run cmd.exe (which I do a lot these days...)

      --
      I've come to... anesthetize you!
  353. Re:Only a geek by nekid_singularity · · Score: 1

    I once saw one that said "I have no command prompt, and I must type>"

    --
    Numbers 31:17,18 Now kill all the boys. And kill every woman who has slept with a man,but save for yourselves every virg
  354. Mondo-Turbo-Turtle Prompt by Turtle+Master · · Score: 1

    Here's mine (warning: contains bash-specific stuff)

    USERNAME="$(whoami)"

    if [ "$USERNAME" = "brett" ]; then
    export LEVEL=${LEVEL:=""}">"
    elif [ "$USERNAME" = "root" ]; then
    export LEVEL=${LEVEL:=""}"#"
    else
    export LEVEL=${LEVEL:=""}"%"
    fi

    if [[ "$TERM" == "dtterm" ]]; then
    ansiTerm=true
    elif [[ "$TERM" == vt* ]]; then
    ansiTerm=true
    elif [[ "$TERM" == [kx]term* ]]; then
    ansiTerm=true
    elif [[ "$TERM" == "ansi" ]]; then
    ansiTerm=true
    elif [[ "$TERM" == "be" ]]; then
    ansiTerm=true
    else
    ansiTerm=false
    fi

    if [ "$ansiTerm" = "true" ]; then
    # ANSII escapes for light green prompt text.
    COLORPROMPT='[0;036m$PWD[0;037m'

    # xterm escape sequences to set the window title.
    TITLENAME='\033]0;\u@\h : $PWD\007'
    PS1=$(echo "$TITLENAME")$(echo "$COLORPROMPT\n$LEVEL ")

    # Save the terminal type in COLORTERM
    export COLORTERM=$TERM

    # Set the terminal to something everyone recognizes
    export TERM=xterm
    else
    PS1=$(echo '$PWD\n$LEVEL ')
    fi

  355. Ahh... the good old days. by interstellar_donkey · · Score: 2
    Reminds me of that time not too long ago before windows when department stores sold computers.

    It was a demented pre-occupation of myself and a close group of freinds to go to various stores (like sears or radio shack... espically radio shack) and modify the autoexec.bat file to display the prompt to read 'fuck the duck'.

    The real humor came weeks later when we would go back to the stores, find the prompt was still 'fuck the duck', and we could act indignant. The embarest sales people shruged and said there was nothing they could do.

    --
    The Internet is generally stupid
  356. My pretty prompt by Hagmonk · · Score: 1

    export PS1="\[\033[1;33m\]\[\033[0m\] "

    Ends up something like:

    Except all coloured and stuff.

    --
    Ash OS durbatulk, ash OS gimbatul, ash OS thrakatulk, agh burzum-ishi krimpatul! Uzg-MS-ishi amal fauthut burgulli.
  357. obey by abe+ferlman · · Score: 2

    This was my prompt on the Sun machines we logged into for years at Pitt:

    Yes, Master?>

    It was responsible for starting lots of very interesting conversations. I'd almost forgotten!

    Bryguy

    --
    microsoftword.mp3 - it doesn't care that they're not words...
  358. Bash Prompts by Lechter · · Score: 1

    Well I use two prompts, depending on whether my terminal supports color. Some terminal programs like Humingbirds switch to an illegible font when you try to escape to colors.

    Without color:

    PS1='$NAME:(`date +%r`) \h:\w\$ '

    With color:

    PS1=`echo -n -e "\033[0m\033[4m\033[34m$NAME\033[0m\033[34m:\033[3 1m(\033[1m\033[35m";date +%r; echo -n -e "\033[0m\033[31m)\n\# \033[5m\033[12m\h:\033[0m\033[1m\033[12m\w\$\033[0 m "`

    $NAME is my name as it's set in /etc/passwd. The two statements specify a two-line prompt. On the topline is my name (blue and underlined) followed by the time (in another color). On the second line is the command number I'm about to execute followed by the name of the server, and my current directory. ...Only took me three on-and-off years to come up with, back when I started playing around in Linux and FreeBSD way back in High School. ;-)

    --
    credo quia absurdum
  359. Prompting Resources by Lechter · · Score: 2

    Thought I'd contribute a couple of links to the discussion: LinuxDiscusssions.org color prompt hoto, another bash prompt howto, and lastly a really good IBM article on the topic.

    Enjoy,
    - Lechty

    --
    credo quia absurdum
  360. Re:Blue Screen of Death (in DOS) by micromoog · · Score: 2

    I saw that too . . . never did figure out how to recover from it (besides just reformatting) . . .

  361. Yeah, but does yours use gawk? by Flat5 · · Score: 1

    PS1="\[\033]0;\u@\h: \w\007\]\[\033[1m\]\u@\h(\$(pwd | gawk -F '{if (NF>n+1)
    {for (i=NF+1-n; i=NF; i++) printf \"/%s\", \$i} else {for (i=2; i=NF; i++) printf \"
    /%s\", \$i}}' n=3 | sed -e 's/\/home\/userid/~/'))\$\[\033[0m\] "

    userid@machine(tilde abbreviated path trimmed to custom depth)$

    The whole thing is bold.

  362. nifty command prompts by wd123 · · Score: 1
    I have several I've self-designed for zsh, they require using the 'prompt' system in 3.1.9/4.0.*: here's what they look like (color not shown, screenshot links available later):

    (user@host:ttyxx) (Day/HH:MM) (right-aligned cwd)
    %
    (user@host:ttyxx) (Day/HH:MM) (right aligned last command)
    % (right aligned cwd)
    [user@machine/ttyxx(cwd)%]
    \user@machine[ttyxx] * cwd\%

    Here's a screenshot to see the four I made for zsh (there are others). Here's a link to my conf files in a .tgz (feel free to look through all of these files). The most important thing to note is the creation of ~/.zsh and the copying of the 'prompt_*_setup' files into that directory, and then the setting of fpath in ,zshrc.

    For awesome custom prompting, I *really* recommend zsh, you can have a lot of fun with a minimal amount of effort. Whipping up those prompts only took me a couple of hours all told. They're also color customizable (see 'prompt -h' for help).

    If you want to try the existing zsh prompts on for size:
    % autoload prompt
    % prompt -h

    -wd
    --
    chip norkus(rl); white_dragon('net'); wd@routing.org
    mercenary albino programmer for hire

    --
    "question = (to) ? be : !be;" --Shakespeare
  363. two-line colorful bash user@host path by Starbreeze · · Score: 1
    Theres a ton of tutorials on this on the web, are people forgetting to search Google again before they Ask Slashdot?

    Nevertheless... here's my pretty prompt -- green user@host with a blue pathname. And on a second line is the actual $ prompt, in case the pathname is long. It's pretty handy.

    export PS1='\[\033]0;\w\007> \033[00;32m\]\u@\h \[\033[01;34m\w\033[0m\]
    \$ '

  364. Scooped by K5! by Starbreeze · · Score: 1
    http://www.kuro5hin.org/?op=displaystory;sid=2001/ 5/1/215312/2648

    Don't people know how to use Google to search for answers anymore? ;)

  365. X compatible by More+Trouble · · Score: 1

    Ok, my prompt is

    usually-hostname:;

    I use csh. When you triple click a command like

    foo:; date

    and paste, csh treats everything left of the ';'
    as a goto label, and the ';' as a null command.
    Thus, "date" gets executed. Nice in an XTerm.

    :wes

  366. all evil by X-Dopple · · Score: 4

    [root@allevil]$

    Yes, my machine is named 'allevil' and I am the root of it.

    1. Re:all evil by NetGuru(42) · · Score: 1

      Yeah Well - what he didn't mention was that he'd actually logged in as 'Luv_of_Munny' and then su'd to root.

      --
      Those who say it cannot be done should not interrupt those who are doing it.
  367. My prompt by Vann_v2 · · Score: 1

    I only do this when I am actually logged in. (su -, that is, not just su). \[\033[0m\]--\[\033[1;31m\][\[\033[1;36m\]\u@\h\[\ 033[1;31m\]]\[\033[0m\]-\[\033[1;31m\][\[\033[1;33 m\]\w\[\033[1;31m\]]\[\033[0m\]-- \[\033[1;32m\] \$ \[\033[0m\]

  368. Command prompt? by jamesots · · Score: 1

    I usually just have a nice white arrow. But when I must, my prompt is plain old $P$G.

    --
    Ho hum for the life of a bear
  369. Most usefull bash shell. Parameters are variable! by ehiris · · Score: 1

    All parameters are variables based on environment.

    PS1='(\u@\H) \d \t\n[\w]\$: '

  370. and another one... by feorlen · · Score: 1

    # .bashrc
    export PS1="\h[\u]:\w$ "

    Result:
    machinename[username]:~/bin$

    I have to be practical when I'm at work, using multiple machines with bizarre huge filesystems. Sometimes the prompt does get rather long...

  371. Article at developerworks by JRiddell · · Score: 1

    This article at developerworks shows you how to do all the fancy bits.

    Mine is \[\e]2;\u@\H \w\a\e[34m\]\u@\h\[\e[0m\]:\[\e[36m\]\w\[\e[0m\]>

    But mind and set your .bashrc to test for TERM being something that can handle the colours

  372. Here's mine... by b1t+r0t · · Score: 2
    (Wow, what a so-lame-it's-cool topic...)

    PS1='\u@\h:\w\$ '

    FWIW, I think it uses some bash-specific features like '\$'. Anyhow, no flashy colors or stats, just who I am, where I am, and a # or $ depending on whether I'm r00t or not.

    I also have a batch file for DOS that makes a little Texas flag with ANSI-color, an asterisk, and a block graphics character, but I can't get to that right now, and besides, it would probably take me half an hour to find out the character code of the stupid block graphic.

    --

    --
    "Open source is good." - Steve Jobs
    "Open source is evil." - Microsoft
  373. Re:What's a command prompt? by DrQu+xum · · Score: 1

    It kinda looks like...

    READY. FASTLOAD


    The Qu+xum has spoken. Nyaaah!

    --
    DrQu+xum: Proof that the lameness filter doesn't work.
  374. bash emulation in ksh by mirabilos · · Score: 1

    Uncomplete, doesn't go through the undocumented
    deeps of the lameness filter, but tada:

    http://members.tripod.de/mirabilos/pub/profile.t xt

    I don't need no ~/.profile so.


    --

    --
    My Karma isn't excellent, damn it! (And /. still does not get UTF-8 right in 2012. Wow.)
  375. My prompt... by sfe_software · · Score: 1
    Mine's pretty dull:
    • PS1="\n\[\033[31m\][\u@\h:\w ]\[\033[37m\]\\$ "
    I use a different color prompt for each box that I log into to avoid confusion (typing "shutdown -h now" when logged into my webserver, for example). Of course I'm quickly running out of colors... The red one above is my home firewall box, yellow my webserver, green on the notebook...

    I have an obnoxiously multi-colored prompt on my MP3 player box - I was really bored one day... but it's the same as above, just more escape codes.

    - Jman
    --
    NGWave - Fast Sound Editor for Windows
  376. The one I see most often... by csmacd · · Score: 1

    Router(config-if)# But, then, I'm a Cisco geek...

    --
    Don't pick up the pho*(@)$*@&@!@ NO CARRIER
  377. Star Trek by devnullkac · · Score: 1

    I've always been partial to a Star Trek theme:

    working>

    --
    What do you mean they cut the power? How can they cut the power, man? They're animals!
  378. I always like a good fortune every now and then... by AlXtreme · · Score: 1
    PS1='/usr/games/fortune'

    problem is that you do more reading than typing, and i think i've looped all the 15 000 fortunes for the third time now ;o)

    Laugh people, you grumpy /.-ers :o)

    --
    This sig is intentionally left blank
  379. prompt 2 by falzer · · Score: 1

    Famous last words:

    --

  380. Re:this is just absurd by unformed · · 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.

    You're right. Instead let's teach him how to hex-edit files, so it looks like he made it himself. Yep, on the road to becoming a script-kiddie.

    No I'm not saying they need to be taught how to break into websites. They shouldn't at all.

    They should be taught how to program. I'd recommend everyone learning either C or asm as a first language; it makes you understand the computer, and how things work.

    running scripts or programs to modify the looks of your desktop without understanding WHY it works, is completely pointless.

  381. mine by zephc · · Score: 1

    PS1='[\u@\h \W]\$ '

    i use this on every system i use
    ----

    --
    "I would say that 99 per cent of what my father has written about his own life is false." - L. Ron Hubbard Jr.
  382. PDA Consoles by lostchicken · · Score: 1
    I always to try and keep my prompt short. Whenever I need to use a serial console, I use a Palm. I can use bash, and the SPARC boot prom. The small screen means short lines. I don't like a palm screen filled with junk. This also keeps shell logs easy to read, and small.

    [current working directory@hostname]#

    This shows me all I need to know.
    twb

    --
    -twb
  383. This Is Scary by Jucius+Maximus · · Score: 1
    At the time of posting, the story on Solar Power in the Third World has averaged about 11 comments per hour over 16 hours.

    And now I look at the story about customisations of command prompts and it has averaged more than 100 posts per hour over 3 hours.

    [making sure my flamesuit is close at hand]

    I seriously hope I'm not trolling/flaming here, but it looks like the /. is proving that it is just as afflicted with The Hunkapiller Syndrome as everybody else.

  384. Me vs. The Slashdot Filters by American+AC+in+Paris · · Score: 5
    Heh. I'd show ya my command line prompt...

    ...but it seems that it's too lame for Slashdot:

    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

  385. rogain? by sheetsda · · Score: 1
    Related Links

    rogain

    Uh... Okay...

    "// this is the most hacked, evil, bastardized thing I've ever seen. kjb"

  386. one for tcsh by transient · · Score: 1

    set prompt="%B%n@%m %~ %%%b "

    clear and concise (if not dull), with three bits of info that are pretty important. also it's easy to tell it apart from commands and output. and of course, for root there's a slight variation:

    set prompt="%B%Sroot%s@%m %~ %%%b "

    --

    irb(main):001:0>
  387. Re:Oh Yeah by entrigant · · Score: 1

    You minimalists need to learn to lighten up and enjoy the machines that you use.

  388. command prompt under bash by orakle · · Score: 1

    my prompt on my freebsd boxen that i admin is usually like this:

    PS1="(\u@\h)[\w]% "

    or like this for root:
    PS1="(\u@\h)[\w]# "

    -

    --
    unzip; strip; touch; grep; mount; fsck; yes; more; fsck; umount; make clean; sleep
  389. my zsh prompt by room101 · · Score: 1

    Not colourfull, but I find it very usefull:
    PROMPT="%B%S%($(/usr/bin/id -u jwalker)#..%n)%s:%m:$(basename $(tty)):%(?..%S%?%s:)%b"

    The first part is colon delimited (yes, very geeky).
    #1, if I am not myself (su'ed), the user name is in standout; otherwise, blank, so the prompt starts with a colon.
    #2, the box name
    #3, the tty (usefull when doing curses work)
    #4, lastly, the return code of the last program (contents of $?) in standout; if it is zero (all okay, it is nothing.

    Now for the right-hand side (I love zsh):
    if [[ ! -z $PSVAR ]]
    then
    RPROMPT="%B%~:(%*)%S$PSVAR%s%b"
    else
    RPROMPT="%B%~:(%*)%b"
    fi

    This is basicly the CWD (relitive to ~), colon the current time. Then, if $PSVAR is defined, display it. I used this when I worked with Informix, and there were multipule instances, so I needed to know when one I was connected to.

    HTH someone. Such a self indulgent topic, but I guess that pretty much sums up most of /. (;-)

    --
    room101 -- how much can you stand before they break you?
    (they always break you eventually)
  390. my prompt for root and users by iocc · · Score: 1

    users (from /etc/bashrc): PS1="[\[\033[37;36;1m\]\u@\h \[\033[33;49;1m\]\W\[\033[0m\]]\\$ "
    root (from /root/.bashrc): PS1="[\[\033[31;49;1m\]\u@\h \[\033[33;49;1m\]\W\[\033[0m\]]\\$ "

  391. My Prompt by Calle+Ballz · · Score: 2

    7204_1#conf t
    Enter configuration commands, one per line. End with CNTL/Z.
    7204_1(config)#

    Any other router people out there?

  392. Anyone seen this article at IBM? by HoldmyCauls · · Score: 1

    http://www-106.ibm.com/developerworks/linux/librar y/l-tip-prompt/

    --
    Emacs: for people who just never know when to :q!
  393. for the bleeding edge linux kernel hackers by digitalboi · · Score: 1

    PS1=`uname -a`

  394. Whasupp$ by Martin+Spamer · · Score: 1

    Whasupp$

  395. My ksh prompt by Mr-Pope · · Score: 1

    PS1="`whoami`@`hostname` {!}$ "

    --
    "The only way to learn a new programming language is by writing programs in it." - Brian Kernighan
  396. What prompt? by DaHat · · Score: 1

    You guys are so stupid, I'm in Windows 2000 and don't have a prompt! I mock you all and your pathetic text prompts... *sobbing* I want my prompt back!!! Have you seen my missing prompt? I think I left it at /home.

    1. Re:What prompt? by DaHat · · Score: 1

      geeze, can't a guy make a joke?

    2. Re:What prompt? by sofar · · Score: 1


      You do have a prompt, go to your start thingy, and then click the 'run' thingy above it somewhere, now, in the box type 'cmd' and then click the 'ok' thingy, Voila, a prompt!!!

      mind you, I won't tell you how to get rid of it!

  397. Re:Still in 2k by DaHat · · Score: 1

    mmm... I think we need to bash this one.

  398. Still in 2k by DaHat · · Score: 2

    Command prompt... I don't use that to much these days, when I do it says... handofthrawn>

  399. Confusing prompts? by J'raxis · · Score: 1

    export PS1="]" # Apple ][e
    export PS1="C:\>" # DOS...
    export PS1="What?\n:" # ex!
    export PS1="?\n" # ed!

    export PS1="\n$( /bin/ls -lp )\n% " #
    This will show the contents of the current directory constantly. I used something like this for a while when I first started using Unix; as I was used to using a GUI and constantly seeing my files in front of me. This would, of course, be reset on run of `cd` or it would be quite stupid.

  400. long and messy :-) by Coryoth · · Score: 1

    PS1="\e[32m,.\e[31m\267\260\e[35m\221\222\e[32m[\e [35m\u@\h\e[32m]\e[35m\222\221\e[31m\260\267\e[32m .,\e[32m,.\e[31m\267\260\e[35m\221\222\e[32m[\e[35 m\d \t\e[32m]\e[35m\222\221\e[31m\260\267\e[32m.,\e[32 m,.\e[31m\267\260\e[35m\221\222\e[32m[\e[35m\#\e[3 2m]\e[0m\n
    \e[0m\e[32m[\e[35m\!\e[32m]\e[35m\w\e[31m>\e[0m"

    Which comes out roughly as:

    ,.''[jedidiah@Wintermute]''.,,.''[Sat Jul 7 18:02:15]''.,,.''[3]
    [502]~>

    Jedidiah
    --

  401. a KSH prompt by arbofnot · · Score: 1

    MCH=$(hostname)
    PS1='[\!]${MCH}(${PWD#/*/*/*/})# '

    This prints the command number in square brackets, the hostname, and the current working directory in parentheses. The directory only displays up to the last 3 subdirectories.

    [42]dbs01(8.1.5/admin/XYZSTAGE)# pwd
    /u01/oracle/product/8.1.5/admin/XYZSTAGE
    [43]dbs01(8.1.5/admin/XYZSTAGE)# cd ..
    [44]dbs01(8.1.5/admin)#

    Makes it easy to know which system and directory you are in, if you administer several systems (and numerous Oracle databases).

  402. Re:Prompt for MCSE's - version 1.1 by snafui · · Score: 1

    No, you don't click on things here$G

  403. Re:Blue Screen of Death (in DOS) by geordie · · Score: 1

    I remember knocking together a turbo basic program which would generate the endlessly recursing subdirectories. Blew the minds of the lecturers who were 'teaching' me at the time. Before they realised what was happening the program had been run on virtually all the PC's in the college by people wanting to see what it did.... lots of reformatting followed.

  404. Atari 800 by ceesco · · Score: 1
    READY

    At least, if I remember correctly ;)

    --
    Ceci n'est pas un sig
  405. Yay gpm by CynicTheHedgehog · · Score: 1

    My prompt is something like this (I don't feel like looking for it)

    export PS1="${USER}@`hostname`:${PWD}\n[`date H:m:s`] ";

    And looks something like this:

    jesses@point-five.net:/home/jesses/Development/
    [15:32:01]

    Which comes in handy not only for knowing where you're at but for quick GPM/Eterm pastes into scp or cvs login commands.

  406. Re:Oh Yeah by kilgore_47 · · Score: 2

    you gotta wonder why these "I'm too leet to customize my box" people are even reading the /. discussion about customizing command prompts. I think the only reason people bother making comments like "I don't waste tme trying to be cool so I don't need change my prompt" is because they're trying to be so cool that they don't have to try to be cool. If they were legitimate not-cool-and-dont-care type hackers, they wouldn't need to share it with the /. community and insult all the 1337 prompts.

    ___

    --
    ___
    The way to see by faith is to shut the eye of reason. --Ben Franklin
  407. Simple is better by pdiaz · · Score: 1

    export PS1="[\W]-> "
    and faster

    --
    Make It Secret . Free JavaScript implementation of AES for your browser
    1. Re:Simple is better by pdiaz · · Score: 1

      Nice trick!

      --
      Make It Secret . Free JavaScript implementation of AES for your browser
  408. From the old mnet/arbornet days by nquartz · · Score: 1

    'Your Blood? '

    --

    --Any sufficiently reliable magic is indistinguishable from technology.

  409. some nice tcsh by foo(foo(foo(bar))) · · Score: 1

    set mch = `hostname - s`
    set wam = `whoami`
    set prompt = "${mch:q}: ${wam} {\!} "
    alias setprompt 'set prompt="${mch:q}: ${cwd}{\!} "'
    alias cd 'chdir \!* && setprompt'

  410. \w in color by wroot · · Score: 1

    Before this /. thread I didn't know you could have color in $PS1. Now my prompt is green when I'm a user and red after /bin/su. I'm wondering though if it's possible to change the color of the directory (\w) depending on whether $PWD is in userland or system (writable by users or not)

    Wroot

  411. Less is more by Sven+Tuerpe · · Score: 1

    #, just #.

    --
    http://erichsieht.wordpress.com/category/english/
  412. My first prompt :-( by 73 · · Score: 1
    When I was a brand new unix newbie, the BOFH changed my prompt to:

    PS1="Catastrophic System Failure: Core Dumped"

  413. prompt by KupekKupoppo · · Score: 5

    c:\>

  414. prompt by er0ck · · Score: 1

    UNI%

  415. Re:mine is all apple ][ like by weeerdo · · Score: 1

    don't forget integer basic (also part of DOS 3.3):

    PS1=">"

  416. prompt by captbrando · · Score: 1

    csh set prompt="%S %p %s [%~] %m(!)%# "

  417. Re:No, the Brits take that title. by SoulSeller · · Score: 1

    Moron.

  418. Re: conditional RC by lvv · · Score: 1

    "display RC only if RC changed" - I like this, going to steel. In my prompt I display RC only if RC != 0

    I also conditionally display user name and host name - only if they different from default. And when UID=root, prompt turns red. And of cause will display colors not only on ANSI compatible terminals (and use colors only if terminal can display it).

  419. Prompt by Gangis · · Score: 1

    Prompt $P$G 'Nuff said.
    -
    Gangis M. Khan
    Unofficial Chrono Trigger 2 project
    http://www.uct2.net

    --
    "Black holes are where God divided by zero." - Steve Wright
  420. Practical jokes by karmawarrior · · Score: 4
    I just modified a co-worker's ksh prompt which was something like:

    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?)
  421. simple, informative, and effective. by fatcock84 · · Score: 1

    PS1="
    $(whoami)@$(hostname) [\$PWD]
    $ "

  422. its not ego, its the truth by UnixTool · · Score: 1

    Something simple to liven up my day. export PS1="\h:\W:Master?

  423. Re:Blue Screen of Death (in DOS) by _ZenZagg_ · · Score: 1

    One of the coolest crashes I can remember is the time I encrypted a .COM file with VOYNICH enrcryption. The odd thing was, the com file still ran...with very odd results; It would spew garbage onto the screen while incessantly beeping and every time it beeped it would print the screen. I miss that program, :P. DEVICE=ANSI.SYS

    --

    "Witty Phrase."

  424. WARNING: read this first before you cut'n'paste!!! by sofar · · 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 /' or something else pretty bad.

    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!

  425. command prompt? by Calamere · · Score: 1

    What's a command prompt?

    Is that the part that says File and then Edit???

    Huh?

    Yes, you should have rolled your eyes at that.

  426. Here's my boring one... by mooniejohnson · · Score: 1

    Those of you who read 'Got Ghand?' sohuld appreciate this one.
    When I login to my UNIX box, it states "I r teh mastar!!1" and my prompt is: TehMastar%>
    (By the way, my computer's name is Mr. Box)

    --

    Elmo knows where you live!

  427. Prompt tells me who I am by mikosullivan · · Score: 1
    My prompts help me keep track of which machine that particular window is connected to. I've too many times edited a CGI on the wrong machine and sat there wondering why it just wasn't working.

    For the machine I use all the time:

    export PS1="[\u]\$ " which gives me:

    [miko]$ To remind me when I'm root:

    PS1="\[\033[41;1;37m\][\u]\[\033[0m\]\$ "

    which gives the the prompt a red background.

    Miko O'Sullivan

    --
    Miko O'Sullivan
  428. bash prompt by no+names+left!!! · · Score: 1

    COLOR1="\[\033[1;35m\]" COLOR2="\[\033[1;36m\]" COLOR3="\[\033[0;35m\]" COLOR4="\[\033[0m\]" PS1="\[$COLOR2[\u@$COLOR1\h][$COLOR2\W]\[\\$\] $COLOR4" - and i noticed that when i put yours in and tried it it didn't wrap propperly !! Mine did that for a while - had to do a bit of tinkering but got it working in the end.

  429. My old DOS prompts by ecarlson · · Score: 1

    In the olden days I used 2 ANSI prompts for DOS, one when I was in pure DOS, and one when I was in a DOS window.

    1. SET PROMPT=$e[1;37;45m$p$e[1;31;45m\$e[1;33;44m

    2. SET WINPMT=$e[1;33;44m[Windows]$e[1;37;45m $p$e[1;31;45m$g$e[0;34;46m

    Of course they both require ANSI.SYS.

    --
    - Eric, InvisibleRobot.com
  430. Lameness filters on adrenaline today by uigrad_2000 · · Score: 1
    Threw out my junk post because of "bad character set", or something like that. So I remove the umlat-A (which _was_ needed for the prompt, but oh well), and I get this:

    Easy does it!

    This comment has been submitted already, 276231 hours , 40 minutes ago. No need to try again.

    No joke. I copied-and-middle-buttoned it myself.

    I'd write to CowbowNeal to let him know, but he's probably to busy changing his prompt right now.

    --
    Free unix account: freeshell.org
  431. ... by starwiz · · Score: 1

    PS1="[-=\h/`whoami`=-]\n\w: "

  432. On the subject of pranks by s20451 · · Score: 1

    I used to be at a military college, and we had some computers for the cadets' use. One fine day, somebody left their computer while still logged in. We had e-mail aliases that could access everyone in the entire college, and for reasons I have yet to understand they were accessible by anyone. Anyway, somebody found this computer logged in and sent an obscene message to the universal alias - so everyone from the General to the lowliest first year got the message, apparently from this hapless guy who left himself logged on.

    The best part is that the colonel in charge of cadets, who mustn't have known much about computers, thought that this represented a breach of national security and nearly court-martialed the guy who left his computer logged on. I think somebody in the engineering faculty straightened it all out and very little ended up happening, though.

    --
    Toronto-area transit rider? Rate your ride.
  433. mine is... by CaptTrips · · Score: 1
    FORMAT C:\> Alternative to this... C : # \ \ RUN!> Alternative to this... .uB3rr0ot\> Alternative to this... .\er> Alternative to this... I turn off my computer and go get a life. ;)

    ----
    Capt' Trips

    --

    grep >= ! == $your
  434. My Prompt says it all by Blowit · · Score: 1

    This is what my prompt says on one of my servers...
    "
    So, Idiot, What do you want to fuck up today?
    C:\>
    "

    --
    *Headline News* censorship shuts down the Internet! More at 6PM!
  435. My simplistic TCSH prompt. by jrwyant · · Score: 1
    (Taken from my .cshrc file.)
    set prompt="%B%T %m %l %h%b %~%B %#%b "

    It looks like this:
    11:29 fhi2009 ttyr7 209 ~ >

    It shows 24hr time, machine, terminal, command number, path.

  436. Re:You really suck by drizuid · · Score: 1

    uh, you are kinda moronic.. he pasted a story from someone else, who knew linus... as you would know had you read the beginning.

  437. ok, i now become troll and flaimbait in one by circletimessquare · · Score: 1

    just look at my sig ;-)

    --
    intellectual property law is philosophically incoherent. it is your moral duty to ignore it or sabotage it
  438. Here's mine... by h0tb0x · · Score: 1

    COLOR1="\[\033[0;36m\]"
    COLOR2="\[\033[1;31m\]"
    COLOR3="\[\033[0;36m\]"
    COLOR4="\[\033[1;37m\]"
    COLOR5="\[\033[1;33m\]"
    COLOR6="\[\033[1;34m\]"
    if [ "$TERM" = "ansi" ]; then
    PS1='`whoami`@`hostname`:`pwd`>'
    else
    PS1="$COLOR2($COLOR3\u$COLOR6@$COLOR3\h$COLOR2:$CO LOR5\w$COLOR2)$COLOR1:> $COLOR4"
    fi

    --
    The phone, the bane of my existance, rings. "Hello, Computer Room" I say, being helpful - BOFH
  439. Oh Yeah by Tachys · · Score: 2

    You can load your command prompt with tons of worthless crap.

    Yeah that will impress the newbies.

  440. Only a geek by Violet+Null · · Score: 5

    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.
    >

  441. prompt by phalse+phace · · Score: 1

    Fatal Error!

  442. i always like aquare brackets by trash+eighty · · Score: 1
    my prompt on unix boxen is usually like :

    [username]

    sometimes i put the path in there too. it reminds me of the OS/2 prompt... ah i loved that

  443. Re:What's a command prompt? by flewp · · Score: 1

    Nononono, but they do, according to myth. I've seen bad videotape footage of happy windows users deep in the forests in the foothills of mountains. They have pointy ears and feathers in their hats if I remember right.....

    --
    WWJD.... for a Klondike bar?
  444. Re:You really suck by dronejam · · Score: 1

    You're the stupid one. the first line says from that guy.

  445. Show me your Can by Skyleth · · Score: 1

    [server] [dir] %

  446. prompts by virion · · Score: 1

    regular user:
    PS1="<\u \h:\[\033[0;32m\]\W \[\033[0m\]|> "
    root:
    PS1="<\[\033[0;31m\]\u\[\033[0m\] \h:\[\033[0;32m\]\W \[\033[0m\]|> "
    and it looks like that:
    <root spanky:root |>
    with colors (red for root)

  447. Woo... Open Firmware by Kira-Baka · · Score: 1

    I use Mac OS 9.1 so if I want a command prompt I have to go into Open Firmware :D (command+option+o+f while you turn power on) My promt is: 0) yay, nice prompt, ehh?

  448. My gripe with bash is by candrade · · Score: 1

    \w always gives ~ for your home directory. That sucks. Of course its a little thing really, but still sucks. Some fun ideas here.
    so here is mine :
    PS1="(\l) [\u@\[\e[31;1m\]\h\[\e[0m\]:\w] $ "
    I dunno, I just like to know what tty I am on (\l) and my server is the firewall, so I like the name to be in bold red
    (\[\e[31;1m\]\h\[\e[0m\]:).

    And yes I put a space between the $ and the end of string. Its just nice to have that space.

  449. 2 lines by unixpro · · Score: 1

    Boring, but shows the current directory on one line, with the hostname and history number on the next. PS1=\w\n[\h] \!\$

  450. my prompt by someonehasmyname · · Score: 2

    This is a simplified version of bashprompt

    ### Uncomment whichever color scheme you want.
    local COLOR_SCHEME=cyan
    #local COLOR_SCHEME=grey
    #local COLOR_SCHEME=red
    #local COLOR_SCHEME=green
    #local COLOR_SCHEME=magenta
    #local COLOR_SCHEME=blue
    #local COLOR_SCHEME=yellow
    #local COLOR_SCHEME=white

    ### Leave these alone, unless you want the sky grass and the green blue =)
    local NOBOLD="\033[0m"
    local BOLD="\033[1m"
    local BLACK="\033[30m"
    local GREY="\033[0m"
    local RED="\033[31m"
    local GREEN="\033[32m"
    local YELLOW="\033[33m"
    local BLUE="\033[34m"
    local MAGENTA="\033[35m"
    local CYAN="\033[36m"
    local WHITE="\033[37m"

    case "$COLOR_SCHEME" in

    black|BLACK)
    local COLOR=$WHITE
    ;;
    grey|GREY)
    local COLOR=$WHITE
    ;;
    red|RED)
    local COLOR=$RED
    ;;
    green|GREEN)
    local COLOR=$GREEN
    ;;
    yellow|YELLOW)
    local COLOR=$YELLOW
    ;;
    blue|BLUE)
    local COLOR=$BLUE
    ;;
    magenta|MAGENTA)
    local COLOR=$MAGENTA
    ;;
    cyan|CYAN)
    local COLOR=$CYAN
    ;;
    white|WHITE)
    export COLOR=$WHITE
    ;;

    esac

    local COLOR1="\[$NOBOLD$COLOR\]"
    local COLOR2="\[$BOLD$COLOR\]"
    local COLOR3="\[$BOLD$BLACK\]"
    local COLOR4="\[$GREY\]"
    local GRAD1="\$(cut -f4 -d\ /proc/loadavg| cut -f2 -d/)"
    local GRAD2="\$(echo \`users | wc --words\`)"
    local GRAD3="\$(cut -f1 -d\ /proc/loadavg)"
    local TTY="\$(tty|cut -d/ -f3)"
    local TIME="\t"
    local DATE="\d"
    local PDP="$COLOR2)$COLOR1$DASH$COLOR2("
    ### PVL wil draw extra stuff from /proc/loadavg .. anyone know FreeBSD equiv?? =)
    local PVL="$PDP$COLOR1$GRAD1$COLOR3/$COLOR1$GRAD2$COLOR3 /$COLOR1$GRAD3"

    PS1="\n$COLOR3$OPENRIGHT$COLOR1$DASH$COLOR2($COLOR 1\u$COLOR3@$COLOR1\h$PDP$COLOR1\#$COLOR3/$COLOR1$T TY$PDP$COLOR1$TIME$COLOR3:$COLOR1$DATE$PVL$COLOR2) $COLOR1$DASH$COLOR3$DASH$COLOR3$CLOSERIGHT$COLOR1$ DASH$COLOR2($COLOR1\w$COLOR2)$COLOR1$DASH$COLOR3$D ASH$COLOR4 "
    PS2="$COLOR2$DASH$COLOR1$DASH$COLOR3$DASH$COLOR4 "

    --
    Common sense is not so common.
  451. Re:REAL funk... by whoisjoe · · Score: 1

    WAY2FONKY$ uname -a
    Linux greatspacetoaster 2.4.5 #4 Tue May 29 17:36:20 MDT 2001 i686 unknown
    WAY2FONKY$

  452. bash random colors. by lin-admin · · Score: 1

    well, kinda. it runs sequentually with each second:

    PS1='\[\033[1;30m\](\[\033[0;36m\]\u\[\033[1;30m \@ \[\033[0;36m\]\h\[\033[1;30m\]\[\033[1;30m\])(\[\0 33[0;3`date +s|sed 's/........//'`m\]\W\[\033[1;30m\]) -\[\033[0;36m\]> \[\033[0;40m\]'

    note: partially copied from www.vulnerable.org/sys (madog).

  453. my prompt for tcsh by mattw+dot+net · · Score: 1

    looks like this:
    [2:03] [mattw@Metallica] [~]

    what it is:
    set prompt="%B[%@]%b [%n@%m] [%~] "

    i dont even have bash installed. (using FreeBSD cos linux is slower)

    this is my first slashdot post.

  454. simple tcsh CL prompt by mrfuzzee · · Score: 1

    set prompt="%S%T-%m-%C2-%h>" gives me the time, machine, two current directory and it's parent as well as the history. Small, simple, everything that I need, without wasting much.