How can i make the date command output yesterday's date, current date and the date 4 days ago, in the following format:
date +% ????
I'm looking for a way to have the "date" command output the date in a specific format.
I'm not familiar with the different ways to use the date command at all.
I need subtract two date values (which are in day of the year format) and the output would give the remaining days. using the command date +"%j" i would get today's 'day of the year' i.e.,
> date +"%j"
Next, i need to take input of a previous date in the format 09/05/2012 and then convert it to 'day of the year format'.