I made an alias of the date command to display date in the following format:
2013.06.14.12.10.02
using this command:
alias date = date +"%Y.%m.%d.%H.%M.%S"
Everything works great, except I want to remove the leading zeroes from the output.
There is no way to make it happen by changing the format. I think it can be done only by piping the output to other commands like sed
and awk
.
The OS I am running is Ubuntu 12.04.2 LTS.
Best Answer
As per the GNU
date
manpage:Therefore you can do
and receive