by Devin Yang
(This article was automatically translated.)

Published - 6 years ago ( Updated - 6 years ago )

The command is different on MacOS or Linux, but can achieve the same effect.
Let's see how to display yesterday's date with the date command.

On MacOS, we pass the following command:
date -v -1d +'%Y-%m-%d'

On Linux:
date -d 'yesterday' +'%Y-%m-%d'

Tags: linux cli

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


Synology,cli

Change the password of my Synology NAS via the command line

Adjust password by command line synouser --setpw admin <yourpassword>

linux,termux

how to play mp4 or webm in android phone background

I have some audio files downloaded from Youtube that I want to play in the background, do I know how to do it?

linux, centos, rsnapshot

How to install rsnapshot on CentOS 7

rsnapshot is a rsync-based tool that can perform snapshot incremental backups. However, we installed which rsnapshot in CentOS. Why is there no such command? There is no way to install it with yum install rsnapshot?