Browse - Programming Tips - How can I make a datestamp to be used in a file name?

Date: 2016aug23
Language: bash

Q.  How can I make a datestamp to be used in a file name?

A.  The date command can do it.

# Make a date stamp of year - month - day DATE=`date +%Y_%m_%d` # Use it to make a file ps -auxw > /tmp/ps_$DATE.txt