Last active
February 5, 2019 02:55
-
-
Save Hungsiro506/8e9921591f2fe15526411edaf4ce8a07 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
date -d '1 hour ago' '+%Y-%m-%d' | |
`Result` : 2017-11-13 | |
date -d '1 hour ago' '+%Y-%m-%d %H' | |
Result : 2017-11-13 22 | |
date -d '1 hour ago' '+%H' | |
22 | |
date '+%H' | |
23 | |
start=$(date -d '2 hour ago' '+%H') | |
end=$(date '+%H') | |
file_name="dns."$start":00:00-"$end":00:00.log" | |
date +'%Y' -> 2019 | |
date + '%Y%m%d' -> 20190205 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment