touch
for filesystem
Creates one or more files.
Signature
> touch {flags} ...rest
Flags
--reference, -r {string}
: change the file or directory time to the time of the reference file/directory--modified, -m
: change the modification time of the file or directory. If no reference file/directory is given, the current time is used--access, -a
: change the access time of the file or directory. If no reference file/directory is given, the current time is used--no-create, -c
: do not create the file if it does not exist--no-deref, -s
: do not follow symlinks
Parameters
...rest
: The file(s) to create.
Input/output types:
input | output |
---|---|
nothing | nothing |
Examples
Creates "fixture.json"
> touch fixture.json
Creates files a, b and c
> touch a b c
Changes the last modified time of "fixture.json" to today's date
> touch -m fixture.json
Changes the last modified time of file d and e to "fixture.json"'s last modified time
> touch -m -r fixture.json d e