我正在尝试运行该find
命令以查找特定文本字符串的总出现次数以及包含此文本字符串的文件数。
我现在拥有的是这个命令。
find . -name "*.txt" | xargs grep -i "abc"
这会报告所有包含文本“abc”的“*.txt”文件。我想要一两个 find 命令来获取
我正在尝试为 unix shell 编写一个 cron,它将删除一些文件,比如在 2 周后或 1 个月后从特定目录中删除。
/somedir1/somedir2/
if(somedir2) contains file with extension .txt or .log
then
check timestamp
if two weeks old delete it
otherwise don't delete.
Run Code Online (Sandbox Code Playgroud)