PS1 | history


The Power of Linux “History Command” in Bash Shell
export HISTTIMEFORMAT='%F %T ' export HISTCONTROL=ignoredups export HISTCONTROL=ignorboth PROMPT_COMMAND=’history -a’ HISTFILE=/home/cadrian/.bash_history HISTSIZE=1000 HISTFILESIZE=1000 # # --- \a  : an ASCII bell character (07) # --- \d : the date in "Weekday Month Date" format (e.g., "Tue May 26") # --- \D{format} : the format is passed to strftime(3) # --- \e : an ASCII escape character (033) # --- \h : the hostname up to the first '.' # --- \H : the hostname # --- \j : the number of jobs currently managed by the shell # --- \l : the basename of the shell’s terminal device name # --- \n : newline # --- \r : carriage return # --- \s : the name of the shell, the basename of $0 (the portion following the final slash) # --- \t : the current time in 24-hour HH:MM:SS format # --- \T : the current time in 12-hour HH:MM:SS format # --- \@ : the current time in 12-hour am/pm format # --- \A : the current time in 24-hour HH:MM format # --- \u : the username of the current user # --- \v : the version of bash (e.g., 2.00) # --- \V : the release of bash, version + patch level (e.g., 2.00.0) # --- \w : the current working directory, with $HOME abbreviated with a tilde # --- \W : the basename of the current working directory, with $HOME abbreviated with a tilde # --- \! : the history number of this command # --- \# : the command 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, # --- \] : end a sequence of non-printing characters export PS1=' ${debian_chroot:+($debian_chroot)} \[\033[01;32m\]\[\033[01;31m\] $(date "+%Y.%m.%d %H:%M") \[\033[01;32m\]\[email protected]\h\[\033[00m\]: \[\033[01;34m\]\w\[\033[00m\]\$ ' export PS1="$(uptime | cut -d " " -f13-16) | \D{%Y.%m.%d %H:%M} \[email protected]\h: " # load average datumal # 3.28, 2.84, 2.55 2013.11.10 20:37 [email protected]: # RedHat -f13-16 | debian, ubuntu -f12-16

http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html

http://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/

http://www.thegeekstuff.com/2008/09/bash-shell-ps1-10-examples-to-make-your-linux-prompt-like-angelina-jolie/

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.