How Do I Print a Previous Date in Linux?
Contents How Can I Get Previous Date in Linux? Yesterday Date Yes_Dat=$(Date –Date=’ 1 Days Ago’ ‘+%Y%D%M’) Day Before Yesterdays Date Day_Yes_Dat=$(Date...
Contents
How can I get previous date in Linux?
- Yesterday date YES_DAT=$(date –date=’ 1 days ago’ ‘+%Y%d%m’)
- Day before yesterdays date DAY_YES_DAT=$(date –date=’ 2 days ago’ ‘+%Y%d%m’)
27 февр. 2014 г.
How do I print only the date in Linux?
You can also use the -f options to provide a specific format instead. Example: date -f “%b %d” “Feb 12” +%F . To set the date in shell using the GNU version of the date command line on Linux, use the -s or –set option. Example: date -s “<DATETIME>” .