[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Prompt in Bash

Gonzalo A. Diethelm wrote:
> A while ago, somebody in this forum posted how to make the current
> working directory appear on the title bar in an xterm. I lost that
> article somehow; could the author repost it? Thanks in advance...

Well, you should have RTFMpage, but here's the excerpt you want:

       a command.  Bash allows these prompt strings  to  be  cus­
       tomized by inserting a number of backslash-escaped special
       characters that are decoded as follows:
              \t     the current time in HH:MM:SS format
              \d     the date  in  "Weekday  Month  Date"  format
                     (e.g., "Tue May 26")
              \n     newline
              \s     the  name  of  the shell, the basename of $0
                     (the portion following the final slash)
              \w     the current working directory
              \W     the basename of the current  working  direc­
              \u     the username of the current user
              \h     the hostname
              \#     the command number of this command
              \!     the history number of this command
              \$     if  the effective UID is 0, a #, otherwise a
              \nnn   the character  corresponding  to  the  octal
                     number nnn
              \\     a backslash
              \[     begin a sequence of non-printing characters,
                     which could be used to embed a terminal con­
                     trol sequence into the prompt
              \]     end a sequence of non-printing characters

Jens B. Jorgensen

TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .

Reply to: