我有以下命令来获取文件日期和时间
adb shell ls -l /sdcard/sample.txt
Result of this command :
-rwxrwxr-x system sdcard_rw 676 2013-09-24 11:23 sample.txt
现在,我也想要2013-09-24 11:23的时间和秒。喜欢2013-09-24 11:23:11
我将如何获得文件修改日期,包括秒数。
谢谢.. :)
如果你有一个 stat 命令:
stat -c %y /sdcard/sample.txt
自纪元以来的秒数
stat -c %Y /sdcard/sample.txt
通过调整发布的代码,我能够使用以下命令使其工作:
adb -d shell ls -l time-style="+%Y-%m-%d %H:%M:%S" path_to_file_in_device
输出是:
-rw-rw-r-- root sdcard_rw 22357385 2013-09-25 22:42 launcher.apk
ls -l --time-style="+%Y-%m-%d %H:%M:%S" /sdcard/sample.txt