Append the time stamp to a file name in Ubuntu Append the time stamp to a file name in Ubuntu bash bash

Append the time stamp to a file name in Ubuntu


Add _%H_%M_%S into the date-format string as well. For example, date +%b_%d_%Y_%H_%M_%S produces a string likeOct_07_2012_17_57_36. For a shorter string, consider format %s; eg, date +%s produces a string like 1349654346, the number of seconds since 1970-01-01 00:00:00 UTC.


Does the following do what you need?

date "+%b_%d_%Y_%H.%M.%S"