March 6, 2007 : nixCraft FAQ Roundup

Posted on in Categories FAQ last updated October 30, 2008

Recently updated/posted Linux and UNIX FAQ:

Shell Scripting: Create Report / Log File Names With Date in Filenames

Posted on in Categories Debian Linux, Howto, Linux, RedHat/Fedora Linux, Shell scripting, Solaris, Suse Linux, Tips, Ubuntu Linux, UNIX last updated January 31, 2016

Sometime you need to create a shell scripts with output filenames with date in it. For example instead of log file named “secure.log”, you can create a filename called “secure-jan-02-06.log” or “secure-DATE-FORMAT.log”. The DATE-FORMAT can be set as per requirements:
=> dd-mm-yyyy
=> mm-dd-yyyy
=> yyyy-mm-dd
=> Month-Day-Year