How to compute date for touch -t
6,898
According to touch man page:
-t STAMP
use [[CC]YY]MMDDhhmm[.ss] instead of current time
where:
CC: First two digit of the year
YY: Last two digits of the year
MM: Month (two-digit numeric month)
DD: Day (two-digit numeric day i.e. day of month)
hh: Hour
mm: Minutes
ss: Seconds
[]
indicates that field is optional
In your examples 1803141400
means: 2018 mar 14, 14.00
and touch
will change time stamp of test1
and test2
files according to this value.
$ ls -l test1 test2
-rw-rw-r-- 1 yourUser yourGroup 0 mar 14 2018 test1
-rw-rw-r-- 1 yourUser yourGroup 0 mar 14 2018 test2
Related videos on Youtube
Author by
Person.Junkie
Updated on September 18, 2022Comments
-
Person.Junkie over 1 year
How to create date type in bash?
what this date mean? '1803141400'
touch -t 1803141400 test1 test2
How can I compute time?