Quote:
Originally Posted by bshipman2k
Is there any way to have this make a directory with yesterdays date? I tried mkdir `date '+%m%d-1%y'` but of course that doesn't work...
|
You can use the -d option to specify a date other than the current date:
Code:
mkdir $(date -d yesterday +%Y%m%d)
you can also specify a certain day and add or subtract hours, days, months and so on, for example:
Code:
$ date -d "3 days ago" # subtract three days from today
$ date -d "20090311 4 days" # add 4 days to 11-Mar-2009
All this is explained in