grep和find,找目录下包含某些内容的文件路径:
grep -ril 190 *
10/_gd_2970.xml
10/_gd_9266.xml
-bash-3.2$ find ./* -type f |xargs -i grep -nH "190" {}| awk -F: '{print $1}'
./10/_gd_2970.xml
./10/_gd_9266.xml
当前时间增加5分钟显示:
-bash-3.2$ date
2013年 08月 02日 星期五 15:23:59 CST
-bash-3.2$ date -d "1970-01-01 UTC $(expr $(date +%s) + 300) seconds"
2013年 08月 02日 星期五 15:29:01 CST
2013年 08月 02日 星期五 15:23:59 CST
-bash-3.2$ date -d "1970-01-01 UTC $(expr $(date +%s) + 300) seconds"
2013年 08月 02日 星期五 15:29:01 CST
Linux下,工具选项都异常强大啊!
未来:jquery、erlang、golang、快手和易语言。要努力学习了!gogogo!
本文介绍了在Linux环境下使用grep和find命令查找特定内容的文件路径的方法,并展示了如何利用这些命令组合来提高搜索效率。此外,还提供了如何在当前时间基础上增加5分钟的具体操作步骤。

1020

被折叠的 条评论
为什么被折叠?



