当前位置:网站首页>find命令详解(文章最后运维最常用操作)
find命令详解(文章最后运维最常用操作)
2022-07-29 05:26:00 【趴着的猫】
find 命令根据日期时间,权限,名字等查找文件和目录
find 目录 参数
常用参数:
-name aa #查找aa的文件
-iname aa #查找aa包含大小写字母
-type #查找文件类型为: f 普通文件 、 l 符号链接 、d 目录、b 块设备。
-size #根据大小查文件
-amin # 查找在系统中最后N分钟访问的文件
-mmin # 查找在系统中最后N分钟里修改过的文件
-mtime -n +n #按文件更改时间来查找文件,-n指n天以内,+n指n天以前
-ctime -n +n #按文件创建时间来查找文件,-n指n天以内,+n指n天以前
-user # 查找属于某个用户的文件
-group #查找属于某个组的文件
-exec: find命令对匹配的文件执行该参数所给出的shell命令。
find /home -name nginx #查找/home目录下名为nginx文件
find /var/log/ -name cron* #查找/var/log目录下名字 cron开头的文件
find /var/log/ -size 500M #查找/var/log目录大小为500M的文件
find /var/log/ -size +100M -size -500M #查找/var/log目录大于500M小于100M的文件
find /var/log -size +1G -exec rm -rf {} \; #查找/var/log目录下1G的文件并使用命令删除常用(结合crontab定时任务): /usr/bin/find /data/ -type f -mtime +30 -exec rm {} \;
删除data目录下30天之前的文件
边栏推荐
- FIR滤波器设计(2)——Vivado调用IP核设计FIR滤波器
- day03_ 1_ Process control
- day14_ Unit test & Date common class & String common class
- Merkletree builds QT implementation UI
- day17_集合下
- Vivado IP核之浮点数加减法 Floating-point
- day17_ Under collection
- Why are the job requirements for software testing in 2022 getting higher and higher? Is there any secret in it?
- day15_ generic paradigm
- day13_ Under multithreading
猜你喜欢
随机推荐
What are the advantages of software testing? See how much you know
Why are the job requirements for software testing in 2022 getting higher and higher? Is there any secret in it?
FIR filter design (1) -- using the FDATool toolbox of MATLAB to design FIR filter parameters
Common server faults and their solutions
基于TCP的在线词典
Hongke will share the EtherCAT demo for you and teach you how to quickly transition from other protocols to EtherCAT industrial bus
Merkle tree existential function modified for the first time
解决分频模块modelsim下仿真输出为stx的错误
NoClassDefFoundError processing
Explain the difference between FIR filter and IIR filter in detail
Hongke automation SoftPLC | Hongke kPa modk operation environment and construction steps (2) -- modk operation environment construction
Solution for website being suspended
高级套接口编程(选项和控制信息)
Scanbasepackages scanning range configuration
华为交换机CE12808导入导出配置文件
2022 summer second day information competition learning achievement sharing 1
How to pre circumvent the vulnerabilities of unsafe third-party components?
浅谈缺陷描写样式
关于DDoS的几个误区
服务器常见故障及其解决方法









