Changed the usage section to be more consistent with the rest of the directory, also added a link to Wikipedia for further details and further consistency.
1.1 KiB
1.1 KiB
title
title |
---|
Bash touch |
Bash command: touch
Creates empty file if filename does not exist or modifies timestamps of existing files to current time.
This command can create multiple empty files in one line of code.
Usage
touch [options] filename
Commonly used options:
-t
change timestamp to specific date ((YYYYMMDDHHMM.SS)) instead of current time.-r
use timestamp from first file to second file.-a
In case you want to only change the access time, use the -a command line option.-m
Similarly, if the requirement is to only change the modification time, use the -m command line option.-h
Is useful if you only want to change the symbolic link, instead of the referenced file.
Examples
touch -t YYYYMMDDHHMM.SS filename
touch -r file1 file2
touch -am file3