by Devin Yang
(This article was automatically translated.)

Published - 8 years ago ( Updated - 8 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


linux

Load the environment variables of .env to the system

Load the environment variables of .env to the system

linux,system

Detect whether selinux is enabled in the system

Detect whether selinux is enabled in the system

nvidia,gpu,cli

Find out what graphics card is used in the computer

What command can be used to check graphics card information? nvidia-smi