Error[8]: Undefined offset: 3, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

概述是否可以使grep命令输出文件修改日期的文件路径,如下所示: 12-02-2015 /file/path/to/the/file16-02-2015 /file/path/to/the/file25-02-2015 /file/path/to/the/file03-04-2015 /file/path/to/the/file 要么: /file/path/to/the/file 12-02- 是否可以使grep命令输出文件修改日期的文件路径,如下所示:
12-02-2015 /file/path/to/the/file16-02-2015 /file/path/to/the/file25-02-2015 /file/path/to/the/file03-04-2015 /file/path/to/the/file

要么:

/file/path/to/the/file 12-02-2015/file/path/to/the/file 12-02-2015/file/path/to/the/file 12-02-2015/file/path/to/the/file 12-02-2015
解决方法 grep本身没有功能.但你可以使用awk.使用该语法:
grep -Hr pattern . | awk -F: '{"stat -c %z " | getline r; print r": "[+++] }'

这迫使grep打印文件名-H. -r表示在给定目录中搜​​索recusive .. awk的字段分隔符设置为:.第一个varibale $1现在包含文件名. awk在每个文件名上调用stat -c%z,以人类可读的格式给出修改时间.它被保存到变量r中,变量r打印在每个搜索结果的前面.

总结

以上是内存溢出为你收集整理的linux – grep输出文件路径与文件修改日期?全部内容,希望文章能够帮你解决linux – grep输出文件路径与文件修改日期?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 166, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
linux – grep输出文件路径与文件修改日期?_系统运维_内存溢出

linux – grep输出文件路径与文件修改日期?

linux – grep输出文件路径与文件修改日期?,第1张

概述是否可以使grep命令输出文件修改日期的文件路径,如下所示: 12-02-2015 /file/path/to/the/file16-02-2015 /file/path/to/the/file25-02-2015 /file/path/to/the/file03-04-2015 /file/path/to/the/file 要么: /file/path/to/the/file 12-02- 是否可以使grep命令输出文件修改日期的文件路径,如下所示:
12-02-2015 /file/path/to/the/file16-02-2015 /file/path/to/the/file25-02-2015 /file/path/to/the/file03-04-2015 /file/path/to/the/file

要么:

/file/path/to/the/file 12-02-2015/file/path/to/the/file 12-02-2015/file/path/to/the/file 12-02-2015/file/path/to/the/file 12-02-2015
解决方法 grep本身没有功能.但你可以使用awk.使用该语法:
grep -Hr pattern . | awk -F: '{"stat -c %z " | getline r; print r": " }'

这迫使grep打印文件名-H. -r表示在给定目录中搜​​索recusive .. awk的字段分隔符设置为:.第一个varibale $1现在包含文件名. awk在每个文件名上调用stat -c%z,以人类可读的格式给出修改时间.它被保存到变量r中,变量r打印在每个搜索结果的前面.

总结

以上是内存溢出为你收集整理的linux – grep输出文件路径与文件修改日期?全部内容,希望文章能够帮你解决linux – grep输出文件路径与文件修改日期?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/yw/1035500.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存