问题描述
|
我正在尝试查找名称为“ 0”的文件,其中包含一个checkCookie字符串,我想按日期列出这些文件,以显示日期,大小,所有者和组。这些文件在我的主目录中。
我有这项工作,但没有显示日期,所有者等。
find /home -name formClass.php -exec grep -l \"checkCookie\" {} \\;
我当时以为可以在列表中添加\“ trhg \\”,但是它不起作用:
find /home -name formClass.php -exec grep -ltrhg \"checkCookie\" {} \\;
谢谢
解决方法
试试
find /home -name formClass.php -print0 | xargs -0 grep -l --null checkCookie | xargs -0 ls -l
,ls -lt `grep -lr --include=formClass.php \"checkCookie\" *`
看一下man ls
还有另一个排序选项。
,似乎有几种方法可以做到这一点。我找到了,它对我有用。
找到/ home -name formClass.php -exec grep -l \“ checkCookie \” {} \\; | xargs ls -ltrhg
感谢您的其他建议。