文件监控

  1. 用inotify
sudo apt-get install inotify-tools
inotifywait -m -r -e modify -e create -e delete /root
  1. 用fswatch
sudo fswatch -o /root | xargs -n1 -I{} echo "File change detected in /root"