From df367b310e46874e4f63547f86a98d6e5edf31a0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Nov 2011 12:56:09 +0100 Subject: [PATCH] prompt howto for bash/zsh Signed-off-by: Nico Schottelius --- blog/my-bash-and-zsh-prompt.mdwn | 29 ++++++++++++++++++ .../bash-zsh-prompt-screenshot-20111125.png | Bin 0 -> 512 bytes 2 files changed, 29 insertions(+) create mode 100644 blog/my-bash-and-zsh-prompt.mdwn create mode 100644 blog/my-bash-and-zsh-prompt/bash-zsh-prompt-screenshot-20111125.png diff --git a/blog/my-bash-and-zsh-prompt.mdwn b/blog/my-bash-and-zsh-prompt.mdwn new file mode 100644 index 00000000..144c83b2 --- /dev/null +++ b/blog/my-bash-and-zsh-prompt.mdwn @@ -0,0 +1,29 @@ +[[!meta title="My Bash and Zsh prompt"]] + +This article is for those who wonder how my very simple but helpful prompt +in the shell are created and the motivation behind it. + +## How it looks like + +[[!img bash-zsh-prompt-screenshot-20111125.png alt="Bash/Zsh Prompt"]] + +## How it is created + +Bash: + + PS1='[\t] \[\033[1m\]\h\[\033[0m\]:\W\$ ' + +Zsh: + + PS1="[%T] %B%m%b:%c%# " + +## Motivation + +# I need the hostname to know on which box I am working +# Time is helpful for copy & paste in logs (and to not waste space with ***xclock***) +# Short directory name (\W, %c) is helpful, long paths make the prompt +unusable and I usually know which tree I am in (if not: pwd helps) +# No need for **username@** like most distros do: If I am a user, +I am ***nico*** (***$*** in bash, ***%*** in zsh). Otherwise I am root (***#***). + +[[!tag config sysadmin unix]] diff --git a/blog/my-bash-and-zsh-prompt/bash-zsh-prompt-screenshot-20111125.png b/blog/my-bash-and-zsh-prompt/bash-zsh-prompt-screenshot-20111125.png new file mode 100644 index 0000000000000000000000000000000000000000..a44e993a61644ec9432bfd5f55fc4ee4988f0df1 GIT binary patch literal 512 zcmV+b0{{JqP)Px#22e~?MF0Q*|NsA`*`M720004EOGiWihy@);00009a7bBm000XU000XU0RWnu z7ytkO2XskIMF-mp84D~l`aB=90004VNklC0LkN6z$R)ryuU`J9Uu z?(ZIB@cz78_yl`iSQ82R!(~0F_~ed&igg=GfeOqov<%VVrWP7XuF=ETQUXJMLcR;F zwFk&z-Tj-SCy9HFrt;8cmz;Itfx(r;JkDAk5uVQ6=dXd>W#Q zIz=V4Z|tUut~#Z?MBX0E&gi1!2GnSU30000