Skip to content

Instantly share code, notes, and snippets.

@Borodin-Atamanov
Last active October 6, 2022 02:34
Show Gist options
  • Select an option

  • Save Borodin-Atamanov/622e1f9af99325011823e606f4cb9c02 to your computer and use it in GitHub Desktop.

Select an option

Save Borodin-Atamanov/622e1f9af99325011823e606f4cb9c02 to your computer and use it in GitHub Desktop.
How to watch file modifications in Linux
echo 16777216 > /proc/sys/fs/inotify/max_user_watches;
echo "@/dev/" > '/dev/shm/inotify.stop';
echo "@/sys/" >> '/dev/shm/inotify.stop';
echo "@/run/" >> '/dev/shm/inotify.stop';
echo "@/home/i/.cache/chromium/" >> '/dev/shm/inotify.stop';
echo "@/home/i/.config/chromium/" >> '/dev/shm/inotify.stop';
inotifywait --monitor -e create,modify,move,delete \
--format '%w%f' --recursive / --fromfile '/dev/shm/inotify.stop' \
| tee /dev/shm/inoty.txt; \
cat /dev/shm/inoty.txt | sort -u > /dev/shm/uni-inoty.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment