タッチコマンド "無効なタイムスタンプ" Android携帯

タッチコマンド

私はadb shellコマンドを使ってAndroidデバイスにシェルをインストールしました。

その後、コマンドを実行しようとしています...

touch -t 201108231405.14 *.png

デバイスの写真ディレクトリにあるすべてのファイルの変更時間を変更します。

私が受け取ったエラーメッセージは次のとおりです。

touch: invalid timestamp specified

私が提供したタイムスタンプにはどのような問題がありますか?

動作せずに出力が出力される次のコマンドを試しました...

touch: usage: touch [-alm] [-t YYYYMMDD[.hhmmss]] <file>

編集する:

私もこの形式にしてみましたが……

1|shell@jfltecan:/sdcard/Pictures/ $ touch -t -c 20110823.140514 *png       
touch: invalid timestamp specified

また、次のコマンドを試しましたが、タイムスタンプも変更されませんでした...

shell@jfltecan:/sdcard/Pictures/NYC $ touch -a -t 20110823.140514 *.png
touch: usage: touch [-alm] [-t YYYYMMDD[.hhmmss]] <file>
ouch -a -t 20110823.140514 IMG_2880.png                                       <
255|shell@jfltecan:/sdcard/Pictures/NYC $ ls -l IMG_2880.png
-rwxrwx--- root     sdcard_r 12462866 2017-09-04 14:39 IMG_2880.png
shell@jfltecan:/sdcard/Pictures/NYC $ 

ベストアンサー1

ここに示すように、touch -tファイルは変更前に作成されます。

touch -a    To change file access and modification time.
touch -m    It is used to only modify time of a file.
touch -r    To update time of one file with reference to the other file.
touch -t    To create a file by specifying the time.
touch -c    It does't create an empty file.

別の方法は次のとおりです。

touch -d '23 August 2011 14:05:14' *.png

-d, --date=STRING
              parse STRING and use it instead of current time

おすすめ記事