本文共 674 字,大约阅读时间需要 2 分钟。
inotifywait 是一个可以实时监控文件变动的工具,它利用linux内核中的inotify机制实现监控功能。
测试监控/etc,inotifywait -m /etc
用putty连接服务器,开启另一个终端,用vim编辑/etc/passwd时,另一个终端显示对应的监控信息
-e 选项指定要监控的“事件”(events)包括了:access、modify、 attrib、 close_write、 close_nowrite、close、open、 moved_to、 moved_from、move、 move_self、 create、delete、delete_self、unmount。
转载地址:http://hjljl.baihongyu.com/