After `touch report.txt`, `wc -c report.txt` can report zero even though the path now exists. I’m curious about the timestamps `touch` assigns as it creates that empty file.
A file’s size and its timestamps tell you different things about what happened to it. Let’s look at the timestamp fields `touch` changes.
What the touch command changes
GNU touch sets atime and mtime to the current time by default and creates a missing path as an empty file, as documented in the Linux touch manual and the POSIX specification.
These timestamp names describe different events, so pick the field that matches the task.
| Field | What it records | Can touch set it? |
|---|---|---|
| Access time (atime) | A recorded file access, such as reading its contents | Yes, with -a or the default action |
| Modification time (mtime) | When file data was last modified | Yes, with -m or the default action |
| Status-change time (ctime) | When file metadata changed | No, the system updates it when metadata changes |
| Birth time | When the filesystem recorded the file’s creation | No, touch does not set it |
Create empty files without changing existing contents
Pass one or more paths to create empty files that do not exist. When a path already exists, touch changes its timestamps and leaves its contents in place.
touch file1.txt
The terminal image shows the new path after touch file1.txt. I ran touch against a file that already held text, and its contents stayed put.

Separate filenames with spaces to create several empty files in one call. Their initial permissions follow the process’s umask.
touch first.txt second.txt
Creating a placeholder is optional when you plan to add text immediately, because an editor can create the path as it saves. Compare other ways to create files on Linux or see how to edit files in Linux.
To update existing paths without creating missing ones, add -c or –no-create.
touch -c file2.txt
The directory listing shows file1.txt after touch -c file2.txt. It does not list file2.txt.

GNU touch suppresses creation and gives no diagnostic for that missing path.
Choose which timestamp to update
Use -a for atime or -m for mtime. Combine both flags when the task needs both timestamps, as the default operation already does.
| Command | Access/modification fields selected |
|---|---|
| touch file1.txt | atime and mtime |
| touch -a file1.txt | atime only |
| touch -m file1.txt | mtime only |
| touch -am file1.txt | atime and mtime |
These flags select atime and mtime values. Linux also updates ctime when touch sets timestamps, as the timestamp interface manual explains.
GNU ls -l shows mtime by default, and –time=atime requests the access time instead.
Plain touch also updates mtime on an existing file. The screenshot compares the long listing before and after the command.

The file is still zero bytes in both listings, so the timestamp change came without a content write.
The mtime screenshot shows touch -m advancing the displayed mtime while the earlier atime stays put. A read through cat can update atime, though the Linux inode manual notes that mount settings can suppress those updates.

The listing after -m shows the updated modification time. The next screenshot asks ls to display atime so the access field is visible.

The -a screenshot displays atime after the command. Without –time=atime, GNU ls -l displays mtime.
Copy timestamps from another file
GNU touch uses the reference file’s atime and mtime, so it creates a missing target with those timestamp values.
touch -r file1.txt file2.txt
The screenshot shows matching timestamps for both paths, because -r copies time metadata but not file data. I compared atime and mtime after the command, and both values matched.

The reference option copies timestamps without writing file content.
Set a specific timestamp
GNU -d parses a date string and assigns it to atime and mtime. The string includes UTC, so stat returns a time with its zone made explicit.
touch -d '2026-09-30 03:30:00 UTC' explicit.txt && stat -c '%y %n' explicit.txt
I set an explicit UTC timestamp, and stat returned 03:30 +0000. The Linux date command covers more GNU date inputs.

POSIX also defines -d with a restricted date-time form. GNU touch accepts more date strings, and -t takes a fixed numeric form in local time.
| Option | Input | Time zone behavior |
|---|---|---|
| -d | Date string | POSIX date-time form, with broader strings accepted by GNU touch |
| -t | [[CC]YY]MMDDhhmm[.ss] | Interpreted in local time |
touch -t 202609300330 numeric.txt
The -t value follows [[CC]YY]MMDDhhmm[.ss] and uses local time. Include a century and year when the value must be unambiguous, and check the POSIX time format before using it in a portable script.
Know what touch cannot change
touch can set mtime without changing file bytes, so a build or sync tool may see a timestamp that does not describe the data.
- It does not write content. On an existing file, touch preserves the bytes and sets timestamps. To create a nonempty file, use an editor or a command that writes the content.
- It does not set ctime or birth time. The system changes ctime when file metadata changes. Birth time is separate and may not be available from the filesystem.
- Permissions still apply. Setting arbitrary times requires ownership or sufficient privilege, as explained in the Linux utimensat manual. A read-only filesystem or denied access also prevents the update.
- Symbolic links have their own boundary. The default follows a symbolic link to its target. GNU -h requests an update to the link itself where supported, as explained in the guide to symbolic links.
- Stored precision varies. A filesystem can round timestamps to its supported resolution, so a displayed value may not preserve every fraction supplied.
The Linux inode manual defines ctime as the status-change timestamp and birth time as the file-creation timestamp. A separate operation such as changing file ownership can update ctime too.
A timestamp describes metadata, not file contents
GNU stat can print access time beside its modification time. Include the ctime format specifier when you need the status-change timestamp too.
stat -c '%n atime=%x mtime=%y ctime=%z' explicit.txt
A newer mtime records a later data-modification timestamp, regardless of what the bytes contain. Read the file to inspect its contents.
Questions about the touch command
What does the touch command do in Linux?
GNU touch updates a file’s access and modification timestamps. If the path does not exist, it creates an empty file unless you use -c.
Does touch change the contents of an existing file?
No. On an existing file, touch changes timestamps and leaves the file contents in place.
How do you create multiple empty files with touch?
Pass the filenames as separate arguments, such as touch first.txt second.txt.
What is the difference between touch -d and touch -t?
GNU -d parses a date string. -t accepts a structured numeric timestamp in local time, with the format [[CC]YY]MMDDhhmm[.ss].
Can touch change a file’s creation time?
No. Touch sets access and modification times. The status-change time updates when metadata changes, and birth time is separate where the filesystem exposes it.
