diff --git a/knowledge base/date.md b/knowledge base/date.md new file mode 100644 index 0000000..517704a --- /dev/null +++ b/knowledge base/date.md @@ -0,0 +1,15 @@ +# Date + +1. [TL;DR](#tldr) + +## TL;DR + +```sh +# Print the current date in the 'YYYY-MM-DD' format. +date '+%F' +date '+%Y-%m-%d' + +# Print the current date in the 'YYYY-MM-DDThh:mm:SS' format. +date '+%FT%T' +date '+%Y-%m-%dT%H:%M:%S' +``` diff --git a/knowledge base/touch.md b/knowledge base/touch.md new file mode 100644 index 0000000..9e8778f --- /dev/null +++ b/knowledge base/touch.md @@ -0,0 +1,12 @@ +# Touch + +1. [TL;DR](#tldr) + +## TL;DR + +```sh +# Change the access and modification date of files. +# End the time with 'Z' to specify the new time is UTC instead of local time. +touch -cd '2017-08-15T13:28:42' '20170815_132842.mp4' +touch -cd '2017-08-15T12:28:42Z' '20170815_132842.mp4' +```