Use the times from a file to set the times on a second file

touch

  • Change a file access and modification times (atime, mtime).
    More information: <https://www.gnu.org/software/coreutils/touch>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

touch -r {{path/to/file1}} {{path/to/file2}}

click the source code to copy install touch on any operating system with command-not-found.com