mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 07:08:01 +00:00
Add Touch Access And Modify Times Individually as a unix til
This commit is contained in:
26
unix/touch-access-and-modify-times-individually.md
Normal file
26
unix/touch-access-and-modify-times-individually.md
Normal file
@@ -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.
|
||||
Reference in New Issue
Block a user