Discussion Locked
0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I can get today's date in the YYMMDD format with "date +%y%m%d". How can I get yesterday's date in the same format?
5 replies
by cpfeiffe
I'm assuming you have this in a script and a variable is set for the date. If so you can just do eval $date -1 for yesterday. If this is not in a script you can still use the eval and some piping on the command line. This varies depending on whatshell you are using, but here is one example:
date +%y%m%d |xargs eval {} -1 \;
by rushr
Poster rated this answer
by rushr
Poster rated this answer
by rushr
This question was closed by the author
This discussion is closed to new replies.
Trending Linux posts
Sort by Trending
0 helpful
7 replies
0 helpful
6 replies
Question Locked
RE: How to fix the Docker and UFW security flaw
0 helpful
3 replies
Discussion Locked
Which Linux works best on old phone or tablet?
0 helpful
5 replies
Discussion Locked
My Job and Company
0 helpful
3 replies