tldr/pages/common/touch.md
Emily Grace Seville c1a467c13a
touch: refresh (#7966)
* Don't use brace expansion syntax in last sample

* Use brace expansion without file extension

* Refresh page:
- better grammar in descriptions
- better command page description
- refresh examples

* Add `--no-create` option

* Better descriptions and placeholder:

- don't use brace expansion
- remove hint in braces

* Reduce repetition in placeholders

* Add OSx touch command

* Use imperative mood

* Apply suggestions from code review

* Apply suggestions from code review

* Use an actual value for --reference

* Use an actual value for -r

* Simplify placeholders and enhance descriptions

* Leave just common/touch.md

* Use short options

* Update "More information" link
2022-12-15 22:28:53 +10:00

703 B

touch

Create files and set access/modification times. More information: https://manned.org/man/freebsd-13.1/touch.

  • Create specific files:

touch {{path/to/file1 path/to/file2 ...}}

  • Set the file [a]ccess or [m]odification times to the current one and don't [c]reate file if it doesn't exist:

touch -c -{{a|m}} {{path/to/file1 path/to/file2 ...}}

  • Set the file [t]ime to a specific value and don't [c]reate file if it doesn't exist:

touch -c -t {{YYYYMMDDHHMM.SS}} {{path/to/file1 path/to/file2 ...}}

  • Set the file time of a specific file to the time of anothe[r] file and don't [c]reate file if it doesn't exist:

touch -c -r {{~/.emacs}} {{path/to/file1 path/to/file2 ...}}