PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to use touch command in linux
How to Use touch Command in Linux (12 Examples)
December 19, 2025 - Use the touch command to set a specific timestamp for an existing file, for example: ... The digits in the square brackets are optional.
Videos
08:06
Linux Command Line Basics Tutorials - touch Command in Linux - YouTube
05:02
Linux Tutorials | touch command | GeeksforGeeks - YouTube
02:28
How to use the touch command: 2-Minute Linux Tips - YouTube
00:37
The 'touch' Command In Linux - YouTube
01:34
5. Linux Tutorials: Linux touch command with examples - YouTube
03:04
16 Touch Command in Linux - YouTube
Server Academy
serveracademy.com › blog › how-to-use-the-touch-command-in-linux
How to Use the Touch Command in Linux - Server Academy
touch -a example.txt # Updates only the access time touch -m example.txt # Updates only the modification time · The `-a` option updates only the access time of a file: ... The `-r` or `–reference` option allows you to update the timestamps of a file based on another file’s timestamps: ... To quickly access help or check the version of the `touch` command, use the `–help` and `–version` options: ... The touch command is indispensable for quickly creating empty files and updating file timestamps...
Hostinger
hostinger.com › home › tutorials › linux touch command: what it is + examples of how to use it to modify timestamps
What Is Linux Touch Command + Practical Usage Examples
August 21, 2025 - The Linux touch command can also set a file’s access and modification time by reading the timestamp information from another file. For example, the following touch command with the r option will scan the timestamp information from reference.txt and set these timestamp values to file_name.txt.
Javatpoint
javatpoint.com › linux-touch
Touch Command in Linux/Unix with Examples - javatpoint
Touch Command in Linux/Unix with Examples for beginners and professionals with examples on files, directories, permission, backup, ls, man, pwd, cd, chmod, man, shell, pipes, filters, regex, vi etc..
Linux Hint
linuxhint.com › touch-command-linux
Touch Command in Ubuntu 22.04 – Linux Hint
Tutorial on the “touch” Linux command to create the empty files or change the file timestamps (last date or time of file access or modification) in Ubuntu.
GeeksforGeeks
geeksforgeeks.org › linux-unix › touch-command-in-linux-with-examples
Creating an Empty File in Linux | Touch Command - GeeksforGeeks
The touch command creates a new, empty file if the file does not already exist. If the file already exists, it updates the file’s last modified timestamp instead of overwriting it.
Published December 8, 2025
Sanfoundry
sanfoundry.com › touch-command-usage-examples-linux
touch Command in Linux - Sanfoundry
November 18, 2023 - 8. If you would like to create a file with specified time other than the current time, then the below command touch command with -t option will gives the abc file a time stamp of 18:30:55 p.m. on December 10, 2012. ... Sanfoundry Global Education & Learning Series – 1000 Linux Tutorials. If you wish to look at all Linux commands and their usage examples, go to Linux Commands Tutorial.
LinuxConfig
linuxconfig.org › home › touch command in linux with examples
touch command in Linux with examples
August 23, 2021 - If you’d only like to change the access time of a file, rather than the modification time, use the -a option in your touch command. ... Conversely, the -m option can be used with the touch command to only update a file’s modification time. ... NOTE You can always use the man command to read more about the touch command and its official documentation. Click the previous link to see how to open the manual pages for any command on a Linux system.
Baeldung
baeldung.com › home › files › guide to the linux touch command
Guide to the Linux touch Command | Baeldung on Linux
March 18, 2024 - $ ls -l example-file.txt sample-file.txt -rw-r--r-- 1 baeldung baeldung 0 Feb 1 17:00 example-file.txt -rw-r--r-- 1 baeldung baeldung 0 Jan 23 22:45 sample-file.txt $ touch -r example-file.txt sample-file.txt $ ls -l example-file.txt sample-file.txt -rw-r--r-- 1 baeldung baeldung 0 Feb 1 17:00 example-file.txt -rw-r--r-- 1 baeldung baeldung 0 Feb 1 17:00 sample-file.txt · At this point, both files are in sync. If we execute the touch command on a symbolic link to a file or directory, the timestamps of the link target are updated:
GeeksforGeeks
geeksforgeeks.org › touch-command-in-linux-with-examples
How to Create an Empty File in Linux | Touch Command - GeeksforGeeks
In this article we discussed two main ways to create empty files in Linux: using the touch and cat commands. The touch command not only updates file timestamps but also conveniently makes empty files. The article explains the syntax and options of touch, with practical examples for single and multiple file creation.
Published July 12, 2024
LINFO
linfo.org › touch.html
How to use the touch command -- by The Linux Information Project (LINFO)
Created August 26, 2005. Updated February 22, 2007. Copyright © 2005 - 2007 The Linux Information Project.
Linux Man Pages
man7.org › linux › man-pages › man1 › touch.1.html
touch(1) - Linux manual page
A FILE argument string of - is ... causes touch to change the times of the file associated with standard output. Mandatory arguments to long options are mandatory for short options too. -a change only the access time -c, --no-create do not create any files -d, --date=STRING parse STRING and ...