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


linux

How to create an ssh key so that your computer can connect to the instance of GCE

Recently, I just started using Google's GCE, and I will record the official Goolge documentation on how to generate a key for the instance to use. The -C comment here will use the name of the logged-in user, and the -t will use rsa.

linux, cli

How to use the find command to find files that have been changed within 7 days

If we have changed some files, how to find out through the command line?

linux

haproxy 1.8.9 compilation record

Record the process of compiling haproxy 1.8.9 under Ubuntu.