-t
não aceita tempo de época, -d
-d, --date=STRING
parse STRING and use it instead of current time
-t STAMP
use [[CC]YY]MMDDhhmm[.ss] instead of current time
Você precisa usar -d
ou --date
em vez de -t
e precisará colocar @
antes de usar o formato epochtime, conforme descrito em date
manpages:
EXAMPLES
Convert seconds since the epoch (1970-01-01 UTC) to a date
$ date --date='@2147483647'
Exemplo:
touch --date=@1442968132 test.txt
Se você quiser alterar apenas o tempo de modificação, use -m
ou --time modify
ou --time mtime
, sem modificar e os horários de acesso serem alterados.
-m change only the modification time
--time=WORD
change the specified time: WORD is access, atime, or use: equivalent to -a WORD is modify or mtime: equivalent to -m
Exemplos:
$ touch --date=@1442968132 test
$ stat test
File: test
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd03h/64771d Inode: 43266017 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ user1) Gid: ( 1000/ user1)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2015-09-23 02:28:52.000000000 +0200
Modify: 2015-09-23 02:28:52.000000000 +0200
Change: 2018-11-23 11:34:59.893888360 +0100
Birth: -
$ touch --date=@1542968132 test
$ stat test
File: test
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd03h/64771d Inode: 43266017 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ user1) Gid: ( 1000/ user1)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2018-11-23 11:15:32.000000000 +0100
Modify: 2018-11-23 11:15:32.000000000 +0100
Change: 2018-11-23 11:35:06.893888073 +0100
Birth: -
$ touch -m --date=@1342968132 test
$ stat test
File: test
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd03h/64771d Inode: 43266017 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ user1) Gid: ( 1000/ user1)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2018-11-23 11:15:32.000000000 +0100
Modify: 2012-07-22 16:42:12.000000000 +0200
Change: 2018-11-23 11:35:22.300887441 +0100