Skip to content

Instantly share code, notes, and snippets.

@artbristol
Last active March 24, 2023 04:54
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save artbristol/e626f942b5c236631af7 to your computer and use it in GitHub Desktop.
Save artbristol/e626f942b5c236631af7 to your computer and use it in GitHub Desktop.
inotify watch a directory with timestamps
inotifywait --monitor --timefmt '%F %T' --format '%T %w%f %e' --recursive $1
@NathanBWaters
Copy link

thank!

@AlbanMarku
Copy link

Thank you sir.

@lutaoact
Copy link

--format '%T %w %e %f'
add %f for file name.

@vuhuythanh1995
Copy link

Thank bro!

@vuhuythanh1995
Copy link

The problem is that after more than 1 hour, inotifywait won't monitor that directory anymore, I have checked with the command ps -ef | grep inotifywait and can't see it running. How do I keep the service running until I turn it off?

@TaeBbong
Copy link

use & to run it on background
inotifywait -m /dir &

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment