Skip to main content
2 of 2
added 1 character in body
Edgar Magallon
  • 5.2k
  • 3
  • 15
  • 29

Using date you specify the following format:

date -r test.txt +'%Y%m%d%H%M.%S' 
  1. %Y: Year (with four digits)
  2. %m: Month number (with two digits)
  3. %d: Day (with two digits)
  4. %H: Hour (from 00 to 23)
  5. %M: Minutes
  6. %S: Seconds

You can check man date to more information.

Edgar Magallon
  • 5.2k
  • 3
  • 15
  • 29