当前位置:网站首页>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 filter design (2) -- vivado calls IP core to design FIR filter
- 基于udp通信的在线多人聊天室
- 多路IO用法
- Hongke case | PAC: an integrated control solution integrating SoftPLC control logic, HMI and other service functions
- HOG+SVM实现行人检测
- DDoS攻击与CC攻击的区别
- day03_1_流程控制
- Plugin location in mavan
- 网站被挂马的解决方案
- Noi online 2022 popular group problem solving & personal understanding
猜你喜欢

基于TCP的在线词典

Circular linked list and bidirectional linked list

What are the advantages of software testing? See how much you know

Hongke will share the EtherCAT demo for you and teach you how to quickly transition from other protocols to EtherCAT industrial bus

day13_多线程下

day17_ Under collection

day04_数组

MerkleTree 构建QT实现UI

自动化测试的生命周期是什么?

三、广域通信网
随机推荐
Circular linked list and bidirectional linked list
day02_基本语法
day12_多线程
多路IO用法
Vivado IP核之复数浮点数除法 Floating-point
Self study understanding of [chain forward star]
Design and simulation code of 4-bit subtracter based on FPGA
注解(Annotation)
The performance and viewing methods of websites attacked by DDoS
DDoS详解
TCP套接口通信实验
6、 Network interconnection and Internet
黑客攻击入侵服务器的6种常见方式
软件测试职业发展:软件测试人员该何去何从
On defect description style
[interview questions] the latest software test interview questions in 2022 (400) [with answers] continue to update
day13_ Under multithreading
TCP based online dictionary
八、 网络安全
What is the basic principle of Library collision and library collision attack