Change the modified date of files Linux

Thanks to James, you can change the last modified date of files in Linux with the following commands:

Change last modified date of a file to 2 hours ago relative to the current date and time:

touch -d "2 hours ago" filename

Change the last modified date of a file to 2 hours ago relative to its current last modified date:

touch -d "$(date -R -r filename) - 2 hours" filename