bashps1

Short date in bash PS1 prompt


You can use \d in the your PS1 configuration to display a long date ie. Tues 18 May, but how can I get it to display it in a format like 18.05.2012 for example?


Solution

  • PS1="\$(date +%d.%m.%Y) > "
    export PS1