Merge pull request #48 from PoplarYang/master

fix typo '//dev/shm/200m' and  add 'current time point for N days ago or after N days'
This commit is contained in:
Bonnie I-Man Ng 2023-03-12 00:07:23 +08:00 committed by GitHub
commit a606d6be45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1145,6 +1145,21 @@ date --date @1615852800
``` ```
##### Print current time point for N days ago or after N days
```bash
# get this time a day ago
date -d"1 day ago" +"%F %H:%M:%S"
# get this time tomorrow
date -d"-1 day ago" +"%F %H:%M:%S"
# get this time 7 days ago
date -d"7 days ago" +"%F %H:%M:%S"
# get this time a week ago
date -d"1 week ago" +"%F %H:%M:%S"
```
##### 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)
```bash ```bash
sleep $[ ( $RANDOM % 5 ) + 1 ] sleep $[ ( $RANDOM % 5 ) + 1 ]
@ -3240,9 +3255,9 @@ fallocate -l 10G 10Gigfile
##### Create dummy file of certain size (e.g. 200mb) ##### Create dummy file of certain size (e.g. 200mb)
```bash ```bash
dd if=/dev/zero of=//dev/shm/200m bs=1024k count=200 dd if=/dev/zero of=/dev/shm/200m bs=1024k count=200
# or # or
dd if=/dev/zero of=//dev/shm/200m bs=1M count=200 dd if=/dev/zero of=/dev/shm/200m bs=1M count=200
# Standard output: # Standard output:
# 200+0 records in # 200+0 records in