Ubuntu – How to change the default date output format for the date command

command linedate

I've used RedHat servers before and now I've just installed Ubuntu Server.

I noticed that the date format in Ubuntu logs is different from in RedHat.

When I use the date command it showd

Wed  May 30 20:00 2012

I want to change it to

2012.5.30.20:00

How can I do that?

Best Answer

You can make an alias for date in .bashrc by typing alias date='date +%Y.%m.%d.%R' and then doing source .bashrc, if you want to change date default format.