🌐
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 - ... Events Let's Meet! ... The touch command's primary function is to modify a timestamp. Commonly, the utility is used for file creation, although this is not its primary function.
🌐
Quora
quora.com › What-is-the-touch-command-in-a-terminal
What is the touch command in a terminal? - Quora
Answer: The ‘touch’ command can be used to update the last accessed and/or last modified date of a file or create a new empty file.
standard Unix program used to change a file's access and modification timestamps
Touch-example.png
touch is a shell command that sets the modification timestamp of an existing file to be current – which on a Unix-based file system includes special files such as directories. If the … Wikipedia
Factsheet
touch
Original author AT&T Bell Laboratories
Developers Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, Randy Smith, TSC, Microware, Apple, Digital Research, Novell, Kris Heidenstrom
Factsheet
touch
Original author AT&T Bell Laboratories
Developers Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, Randy Smith, TSC, Microware, Apple, Digital Research, Novell, Kris Heidenstrom
🌐
Wikipedia
en.wikipedia.org › wiki › Touch_(command)
touch (command) - Wikipedia
1 month ago - touch is a shell command that sets the modification timestamp of an existing file to be current – which on a Unix-based file system includes special files such as directories. If the input path does not specify an existing file, then it creates a new, regular file at the path.
🌐
Server Academy
serveracademy.com › blog › how-to-use-the-touch-command-in-linux
How to Use the Touch Command in Linux - Server Academy
2. Updating Timestamps**: touch filename updates the access and modification times of an existing file to the current time. 3. Setting Specific Timestamps**: Use the -t option followed by a timestamp in the format [[CC]YY]MMDDhhmm[.ss] to set precise dates and times. The basic syntax of the `touch` command is straightforward:
🌐
TecMint
tecmint.com › home › linux commands › 8 practical examples of linux “touch” command
8 Practical Examples of Linux "Touch" Command
July 13, 2023 - For example, the below command touch command with -t option will give the tecmint file a time stamp of 18:30:55 p.m. on December 10, 2020. ... We’ve almost covered all the options available in the touch command for more options use “man touch“. If we’ve still missed any options and you would like to include them in this list, please update us via the comment box.
🌐
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
Find elsewhere
🌐
IBM
ibm.com › docs › ssw_aix_72 › t_commands › touch.html
touch Command
We cannot provide a description for this page right now
🌐
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 - As a result, the Linux touch command is mainly used to manipulate file or folder access and modification time. Keep in mind that there is no way to set or change ctime manually.
🌐
LINFO
linfo.org › touch.html
How to use the touch command -- by The Linux Information Project (LINFO)
The touch command is the easiest way to create new, empty files. It is also used to change the timestamps (i.e., dates and times of the most recent access and modification) on existing files and directories · touch [option] file_name(s)
🌐
Gcore
gcore.com › home › developers › how to use the touch command in ubuntu
How to Use the Touch Command in Ubuntu | Step-by-step Guide
April 8, 2025 - If you want to create the file in a specific directory, navigate to that directory using the cd command. For example: ... o create an empty file, use the “touch” command followed by the desired file name.
🌐
Namehero
namehero.com › blog › getting-started-with-the-touch-command-in-linux
Getting Started With The Touch Command In Linux
November 6, 2024 - Let’s delve into the individual ... filename in the terminal on an existing file updates the access time and modification time of the specified file to the current time....
🌐
How-To Geek
howtogeek.com › home › linux › how to use the touch command on linux
How to Use the touch Command on Linux
August 14, 2024 - We can tell touch to take the timestamps from an existing file and replicate them on a target file. This let’s you set the timestamps of a file or group of files to a existing file that you know has the timestamps you want. It saves you figuring out how to write the timestamps in either the -d or -t formats, and typing the format string on the command line.
Top answer
1 of 2
1

The Bash version included with macOS is quite old (3.2.57 as of Monterey 12.3.1) and doesn't honor leading zeros when expanding {01..10}, but newer versions of Bash do (from man bash):

A sequence expression takes the form {x..y[..incr]}, where x and y are either integers or single characters, and incr, an optional increment, is an integer. When integers are supplied, the expression expands to each number between x and y, inclusive. Supplied integers may be prefixed with 0 to force each term to have the same width. When either x or y begins with a zero, the shell attempts to force all generated terms to contain the same number of digits, zero-padding where necessary.

I'd recommend that you install Homebrew and then Bash (5.1.16 as of this writing), and configure Terminal to use that version instead (correct the path below accordingly):

2 of 2
2

Without installing a package manager and then a newer version of your shell, you could work with the tools you have. Using the builtin command printf you could-

touch $(printf "file_%02d.txt " {1..10})

You could also use the external command jot-

touch $(jot -s " " -w 'file_%02d.txt' 10)

Now if you wanted to use the bash5 sequence expression {START..END[..INCREMENT]} then -

jot -s " " -w 'file_%02d.txt' 4 2 10

where 4 equal the number of times printed, 2 equals the increment, and 10 equal the maximum value.

Of course after all, you could use zsh within your "default" shell to do the lifting-

zsh -c 'touch file_{01..10}.txt'
🌐
Educative
educative.io › answers › what-is-the-touch-command-in-linux
What is the touch command in Linux?
The touch command comes as part of the GNU Core-utilities and creates a new file in Linux using the terminal.
🌐
iO Flood
ioflood.com › blog › touch-linux-command
Using the Touch Command in Linux | Reference Guide
December 19, 2023 - Another common use of the touch command is to update the timestamps of an existing file. Here’s an example: touch existingfile.txt ls -l existingfile.txt # Output: # -rw-r--r-- 1 user group 0 Jan 1 00:10 existingfile.txt · In this case, we used the touch command to update the timestamp of ‘existingfile.txt’. We can see from the output of the ls -l command that the timestamp has been updated to the current time.
🌐
LabEx
labex.io › questions › what-is-the-purpose-of-the-touch-command-in-linux-270254
What is Touch Command in Linux | LabEx
July 25, 2024 - Learn the purpose of the touch command in Linux for creating new files and updating timestamps efficiently.