Color highlight & timestamp your bash cli prompt

 To color highlight your bash cli simply edit /etc/bash.bashrc and add the following lines:


force_color_prompt=yes

    if [ "$LOGNAME" = root ] || [ "`id -u`" -eq 0 ] ; then
        PS1='\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;34m\]#\033[00m\] '
    else
        PS1='\u@\h:\w\$ '
    fi
 

Example:

Additionally you can show the timestamp by adding export PROMPT_COMMAND="echo -n \[\$(date +%H:%M:%S)\]\ " into your ~/.bashrc file:

No comments:

Post a Comment

Powershell Website "Ping" using the winsystems web proxy

If you want to monitor/check (every 10s) continuesly if a website (in this exampe  http://www.google.de ) is reachable using powershell and ...