首页文章正文

mtime +7,mtime +5

电影time 2023-11-16 20:32 264 墨鱼
电影time

mtime +7,mtime +5

mtime +7,mtime +5

本文将介绍如何清除Linux系统7天前的日志。 要清除Linux系统中的日志,我们可以使用命令行工具。 这里我们以清除系统日志为例。首先打开终端,输入以下命令:```find/varfind/var/log-typef-mtime+7-okrm{}\;//查找/var/log目录中时间为7天之前的普通文件,并要求它们在删除前查找。-typef-perm644-execls-l{}\;//查找上一个目录

方法一:[root@localhostlogs]#find/app/logs/-typef-mtime+7|xargsrm-f​​方法二:[root@localhostlogs]#find/app/logs/-typef-mtime+7-execrm-f{}\; 方法三:[ro#iostatLinux4.4.73-5-defaultJuly8,2021_x86_64_(40CPU)avg-cpu:%user%nice%system%iowait%steel%idle2.500.410.940.020.0096.13De

您会发现找到的文件是从现在起24小时范围内的文件。 但不包括从724小时到824小时的时间范围。 那么-mtime+7应该就很容易理解了。 这就是通过指定时间来查找的意思。 类似的参数还有:mtime+7,根据文件的更改时间来搜索文件。7表示文件在7天前被更改;如果是-mmin+7,则表示文件在7分钟前被更改。 execrm{};表示执行shell命令,在exec选项之后

╯ω╰ #删除/home/fengshuiyue目录下的目录oneweekagofengshuiyue@ralc:~>找到/home/fengshuiyue-maxdepth1-typed-mtime+7!-path/home/fengshuiyue-execrm-rf{}\;-maxdepthnumber:Directory[root@centos6~]# vi/server/scripts/del.shandaddfind/app/logs-typef-name"access*.log"-mtime+7|xargsrm–f;或者addfind/app/logs-t

linuxfindmtime7,linuxfindcommandmtimeatimectime+n-。 。 。 1.Manfindexplanation:find-searchforfilesinadirectoryhierarchy,即:searchforfilesinadirectory2.Find/var/log-typef-mtime+7-okrm{whenthefileismodified}\;#Findallordinaryfileswithafilelengthof0inthesystemandlisttheirfullpathsfind/-typef-size0-execls-l{}\;6.查询字符grep命令

后台-插件-广告管理-内容页尾部广告(手机)

标签: mtime +5

发表评论

评论列表

佛跳墙加速器 Copyright @ 2011-2022 All Rights Reserved. 版权所有 备案号:京ICP1234567-2号