Uploaded November 2025 | Updated November 2026, 4 days ago
The 'touch' command is used to change file timestamps or to create empty files.
- Create empty files:
touch file1 file2 ...
- Set file [a]ccess or [m]odification times to the current one:
touch -a|m file1 file2 ...
- Set file [a]ccess or [m]odification times to the current one but "don't create" files if they don't exist:
touch -c -a|m file1 file2 ...
NOTE Use 'stat file1' to view file info.
- Set the file [t]ime to a specific value and don't create file if it doesn't exist:
touch -c -t YYYYMMDDHHMM.SS file1
NOTE: touch -c -t 202511160813.00 file1
- Set the files' timestamp to the reference file's timestamp:
touch -r reference_file file1 file2 ...
- Set the timestamp by parsing a string:
touch -d "last year|5 hours|next thursday|nov 14|..." file1
- Create multiple files with an increasing number:
touch file{1..10}
- Create multiple files with a letter range:
touch file{a..z}
- Cat a file that containts a list of filenames into touch:
NOTE The file named "list" contains the following...
#+begin_example
file1.txt
file2.txt
file3.txt
#+end_example
cat list | xargs touch
-OR-
touch $(cat list)
REFERENCED:
βΊ gitlab.com/dwt1/vidman
WANT TO SUPPORT THE CHANNEL?
π° Patreon: patreon.com/distrotube
π³ Paypal: paypal.com/donate/?hosted_button_id=MW3ZFGS8Q9JGW
ποΈ Amazon: amzn.to/2RotFFi
π Teespring: teespring.com/stores/distrotube
DT ON THE WEB:
πΈοΈ Website: http://distro.tube
π GitLab: gitlab.com/dwt1
π¨οΈ Mastodon: fosstodon.org/@distrotube
π« Reddit: reddit.com/r/DistroTube
π½οΈ Odysee: odysee.com/@DistroTube:2
FREE AND OPEN SOURCE SOFTWARE THAT I LIKE:
π Brave Browser - brave.com
π½οΈ Open Broadcaster Software: obsproject.com
π¬ Kdenlive: kdenlive.org
π¨ GIMP: gimp.org
π» VirtualBox: virtualbox.org
ποΈ Doom Emacs: github.com/hlissner/doom-emacs
Your support is very much appreciated. Thanks, guys!
The 'touch' command is used to change file timestamps or to create empty files.
- Create empty files:
touch file1 file2 ...
- Set file [a]ccess or [m]odification times to the current one:
touch -a|m file1 file2 ...
- Set file [a]ccess or [m]odification times to the current one but "don't create" files if they don't exist:
touch -c -a|m file1 file2 ...
NOTE Use 'stat file1' to view file info.
- Set the file [t]ime to a specific value and don't create file if it doesn't exist:
touch -c -t YYYYMMDDHHMM.SS file1
NOTE: touch -c -t 202511160813.00 file1
- Set the files' timestamp to the reference file's timestamp:
touch -r reference_file file1 file2 ...
- Set the timestamp by parsing a string:
touch -d "last year|5 hours|next thursday|nov 14|..." file1
- Create multiple files with an increasing number:
touch file{1..10}
- Create multiple files with a letter range:
touch file{a..z}
- Cat a file that containts a list of filenames into touch:
NOTE The file named "list" contains the following...
#+begin_example
file1.txt
file2.txt
file3.txt
#+end_example
cat list | xargs touch
-OR-
touch $(cat list)
REFERENCED:
βΊ gitlab.com/dwt1/vidman
WANT TO SUPPORT THE CHANNEL?
π° Patreon: patreon.com/distrotube
π³ Paypal: paypal.com/donate/?hosted_button_id=MW3ZFGS8Q9JGW
ποΈ Amazon: amzn.to/2RotFFi
π Teespring: teespring.com/stores/distrotube
DT ON THE WEB:
πΈοΈ Website: http://distro.tube
π GitLab: gitlab.com/dwt1
π¨οΈ Mastodon: fosstodon.org/@distrotube
π« Reddit: reddit.com/r/DistroTube
π½οΈ Odysee: odysee.com/@DistroTube:2
FREE AND OPEN SOURCE SOFTWARE THAT I LIKE:
π Brave Browser - brave.com
π½οΈ Open Broadcaster Software: obsproject.com
π¬ Kdenlive: kdenlive.org
π¨ GIMP: gimp.org
π» VirtualBox: virtualbox.org
ποΈ Doom Emacs: github.com/hlissner/doom-emacs
Your support is very much appreciated. Thanks, guys!










