Linux
inotify是一种强大的、细粒度的、异步文件系统监控工具,它满足各种各样的文件监控需求,包括:访问属性、读写属性、权限属性、删除创建、移动等操作
介绍
inotify-tools 支持在命令行下对文件系统事件进行监控,inotify-tools 由两部分组成:
inotifywait收集有关文件访问信息inotifywatch监视的文件系统
查看系统内核是否支持:
$ ls /proc/sys/fs/inotify
max_queued_events max_user_instances max_user_watches使用
安装
yum install inotify-tools示例
inotifywait -mrq --timefmt "%y-%m-%d %H:%M" --format "%T %w%f %e" -e modify,delete,create,attrib,move,open --outfile "/tmp/inotify.log" --fromfile "/tmp/file.txt"说明:
--timefmt时间格式--format输出格式-e监控的事件,参数包括:open打开文件modify修改文件delete删除文件create新建文件attrib属性变更move移动文件
--outfile事件日志输出--fromfile读取需要监视的文件或排除的文件,每行一个文件或文件夹,排除的文件以@开头
- 上一页: Sealed Secrets 介绍
- 下一页: yq 命令行解析 yaml
最近更新
相关文章
- parallel 并行命令
- systemd-timesyncd Linux 时间同步服务介绍
- systemd-cgtop 显示 cgroups 资源使用情况
- systemd-cgls 显示 cgroups 内容
- systemd-resolved: Linux DNS 解析服务介绍
- systemd-resolved、systemd-networkd、NetworkManager、netplan 的关系和联系
- systemd-journald/journalctl Linux 日志管理介绍
- systemd-sysctl 服务介绍
- Linux timeout 命令
- dmesg Linux故障工具:显示内核信息
最新评论