Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I used redhat as server and now i've just installed ubuntu server. the problem is the output date format in logs is diffrent from redhat. when i use date command it show wen may 30 20:00 2012 now i want to change it to 2012.5.30.20:00 pleas help me to do that. by the w

share|improve this question
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.

share|improve this 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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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