Change Last Modified Date of a File in Linux

11 Sep 2025

Update File Timestamps in Linux

How to Change the Last Modified Date of a File in Linux

Changing the last modified date of files in Linux can be vital for managing your files and keeping your system organized. This guide will walk you through various methods, primarily utilizing the `touch` command, along with additional tips and use cases.

Understanding the Touch Command

The `touch` command is a standard feature in Linux that alters file timestamps. The primary functionality includes:
  • Creating empty files if they do not exist.
  • Updating the last modified and access times of existing files.

Basic Syntax

To change the last modified date of a file, use the following command in your terminal: touch -t YYYYMMDDhhmm.ss filename Where:
  • YYYY: Year
  • MM: Month
  • DD: Day
  • hh: Hour
  • mm: Minute
  • ss: Seconds (optional)

Example Usage

Suppose you want to set the last modified date of a file named `example.txt` to October 1, 2023, at 3:45 PM. You would run: touch -t 202310011545.00 example.txt

Changing the Timestamp to Current Time

If you simply want to update the file's last modified time to now, you can just run: touch example.txt This updates the timestamp to the current date and time.

Using the Date Command

For more complex date manipulation, you can also use the `date` command in combination with `touch`. For example: touch -d "2023-10-01 15:45" example.txt

Common Use Cases

You might want to change the last modified date of files for various reasons, including:
  1. Keeping logs organized by modification dates.
  2. Updating timestamps for bartering with version control systems.
  3. Correcting errors in file timing caused by system issues.

Conclusion

These methods provide effective ways to change the last modified date of files in Linux. Using the `touch` command is quick and efficient, making it the go-to solution for many users. As with any command-line operation, take care to specify the correct file names and dates, ensuring system integrity and proper file management.
Last Changed Files

Last Changed Files download for free to PC or mobile

Latest update Last Changed Files download for free for Windows PC or Android mobile

3
835 reviews
2593 downloads

News and reviews about Last Changed Files

11 Sep 2025

How to Change Last Changed Files in Java

Learn how to change last changed files in Java effectively. Manage your file's last modified date with ease!

Read more

11 Sep 2025

How to Change the Last Modified Date of a File Windows 7

Learn how to adjust the last changed files in Windows 7 efficiently. Master file date modifications now!

Read more

11 Sep 2025

Change Last Modified Date of a File in Linux

Learn how to change the last modified date of a file in Linux effortlessly. Manage your files better today!

Read more