php - 获取目录的最后修改时间

标签 php linux scripting directory timestamp

我知道这不是目录的实际“修改”时间,但我需要时间戳,而且我正在努力确定如何获取它。我实际上打算在 PHP 脚本中使用此命令的输出,但我没时间。

stat -f "%y" zip

我不断收到消息 stat: cannot read file system information for '%y': No such file or directory

最佳答案

%y 用于定义输出格式。您只能在 -c 标志后设置输出格式。你想要的是:

stat -c %y zip

关于php - 获取目录的最后修改时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7799528/

相关文章:

php - 如何合并具有相同值的键?

php - 信用卡号码和有效期的组合是否唯一?

python - Linux Red Hat 上的 Korn Shell 脚本

linux - 由于公钥问题需要帮助克隆 GitHub 存储库

windows - 从 VBScript 中的函数返回引用

linux - 用于登录的 shell 脚本

php - 如何防止 PHP 中的 SQL 注入(inject)?

php - Yii 框架 + WP 风格(使用 WP 数据库表)后层次结构 : I need to order categories and subcategories

linux - 在 Linux 机器或 VM 上安装 Eclipse Kura

bash - BASH中的多线程变量创建