- Print date with formatting
This commit is contained in:
bonnie 2020-07-19 22:14:19 +08:00
parent 8e6a0f8eb9
commit 3d6f8bcda1

View File

@ -1089,10 +1089,14 @@ time echo hi
sleep 10 sleep 10
``` ```
##### Print date in %Y-%m-%d ##### Print date with formatting
```bash ```bash
date +%F date +%F
# 2020-07-19 # 2020-07-19
# or
date +'%d-%b-%Y-%H:%M:%S'
#10-Apr-2020-21:54:40
``` ```
# wait for random duration (e.g. sleep 1-5 second, like adding a jitter) # wait for random duration (e.g. sleep 1-5 second, like adding a jitter)