From ada3dcdbb5ab55319b4df91af4b03146e05b7f41 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Mon, 30 Jul 2018 16:53:03 -0500 Subject: [PATCH] Add Touch Access And Modify Times Individually as a unix til --- README.md | 3 ++- ...ch-access-and-modify-times-individually.md | 26 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 unix/touch-access-and-modify-times-individually.md diff --git a/README.md b/README.md index 7541470..af36aa8 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/). For a steady stream of TILs from a variety of rocketeers, checkout [til.hashrocket.com](https://til.hashrocket.com/). -_694 TILs and counting..._ +_695 TILs and counting..._ --- @@ -664,6 +664,7 @@ _694 TILs and counting..._ - [SSH With Port Forwarding](unix/ssh-with-port-forwarding.md) - [Sort In Numerical Order](unix/sort-in-numerical-order.md) - [Switch Versions of a Brew Formula](unix/switch-versions-of-a-brew-formula.md) +- [Touch Access And Modify Times Individually](unix/touch-access-and-modify-times-individually.md) - [Undo Some Command Line Editing](unix/undo-some-command-line-editing.md) - [View A Web Page In The Terminal](unix/view-a-web-page-in-the-terminal.md) - [Watch The Difference](unix/watch-the-difference.md) diff --git a/unix/touch-access-and-modify-times-individually.md b/unix/touch-access-and-modify-times-individually.md new file mode 100644 index 0000000..aa9b5ff --- /dev/null +++ b/unix/touch-access-and-modify-times-individually.md @@ -0,0 +1,26 @@ +# Touch Access And Modify Times Individually + +When running the `touch` command on an existing file: + +```bash +$ touch README.md +``` + +The `Access` and `Modify` times of that file will be updated to the current +time. + +You can update these values individually with the `-a` and `-m` flags. + +To update just the access time: + +```bash +$ touch -a README.md +``` + +To update just the modify time: + +```bash +$ touch -m README.md +``` + +See `man touch` for more details.