YY – Specifies the last two digits of the year. If the value of the YY is between 70 and 99, the value of the CC digits is assumed to be 19. If the value of the YY is between 00 and 37, the value of the CC digits is assumed to be 20. It is not possible to set the date beyond January 18, 2038.
Kommentarer6
touch -t 20200429153344
touch -t 20200429153344 test.txt
til
touch -t 20200429153344_test.txt
Prøv
Eller måske er det dette du søger?
https://www.unix.com/shell-programming-and-scripting/112439-how-create-…
The following explains the
The following explains the above format:
CC – Specifies the first two digits of the year
YY – Specifies the last two digits of the year. If the value of the YY is between 70 and 99, the value of the CC digits is assumed to be 19. If the value of the YY is between 00 and 37, the value of the CC digits is assumed to be 20. It is not possible to set the date beyond January 18, 2038.
MM – Specifies the month
DD – Specifies the date
hh – Specifies the hour
mm – Specifies the minute
SS – Specifies the seconds
For example:
$ touch -t 203801181205.09 tgs.txt
Så løsningen blev
touch -t 202004291627.33 test.txt
Man kan også bruge -d
Man kan også bruge -d parametren som parser en dato/tid streng. Eksempler:
touch -d "2020-04-30 19:17:36" test
touch -d "tomorrow" test
touch -d "tomorrow 20:30" test
touch -d "next monday 19:30" test
touch -d "+2 hours 30 minutes" test
Eller standarden, touch test, som sætter tidsstemplet til lige nu.
Man kan også bruge -d
#3: Man kan også bruge -d parametren som parser en dato/tid streng. Eksempler:
Må jeg bruge dine eksempler til en vejledning om tidsstempler med touch
Må jeg bruge dine
#4: Må jeg bruge dine eksempler til en vejledning om tidsstempler med touch
Ja gerne.
Takker
#5:
Takker