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


How can I do that?

2 Answers 2


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.

date --help


man date

both explain how to define a custom format for the output of the date command.

What you're looking for can be found with

date +%Y.%m.%d.%R

with everything after the + being the string to output with the variables from the current date.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.