监控命令的输出
[test@06_09 test]$ watch 'ls -alrht'
[test@06_09 test]$ watch -d 'ls -alrht'
对文件及目录访问进行记录
inotify
vim watchdir.sh
#!/bin/bash
path=$1
inotifywait -m -r -e create,move,delete $path -q
chmod +x watchdir.sh
./watchdir.sh .
watch -n 0.5 ssh -p2013 test@127.0.0.1 mysqladmin -uroot -pmyshop_168 processlist | tee -a /home/test/processlist.txt