To change the file modification time in Linux, you can use the touch command with the -m option. Here’s how to do it:
Change to the Current Time: To update the modification time of a file to the current time, simply use:
touch filename.txtSet a Specific Modification Time: To set a specific modification time, you can use the
-toption followed by the desired timestamp in the format[[CC]YY]MMDDhhmm[.ss]. For example, to set the modification time to January 1, 2023, at 12:00 PM:touch -t 202301011200 filename.txtUsing a Reference File: You can also set the modification time of a file to match another file's modification time using the
-roption:touch -r reference_file.txt target_file.txt
These commands allow you to effectively change the modification time of files in the Linux file system.
