Formatting a Julian Date [Julian Day / Day of Year] in UnixPosted: January 14, 2011 | Author: tech0x20 | Filed under: Rediscovering Unix | Tags: date, julian, shell script, unix | Leave a comment »
This is one of those commands that’s so simple once you recall it that you’ll smack yourself for not knowing it.
If you’re ever in doubt, man date.
# displays the 2-digit year + day of the year, Jan 14, 2011 = "11014"
# sets filename to MyFilename + 2-digit year + day of the year
# Jan 14, 2011 = MyFilename11014
Remember to use lowercase ‘y’. Uppercase ‘Y’ will give you a 4-digit year.