You are not logged in.

#1 2025-11-05 08:18:38

duyinthee
Member
Registered: 2015-06-14
Posts: 241
Website

inotifywait does not print filename that edited

I am trying to get it works.

inotifywait --event modify --format '%w%f' ./*

it only print

Setting up watches.
Watches established.

while waiting. then, after a file is edited in the directory, nothing show up.

Offline

#2 2025-11-05 10:00:24

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 438

Re: inotifywait does not print filename that edited

Do you edit a file which exists at the moment of inotifywait invokation, or create it after inotifywait run?
./* argument is expanded by shell to existing files, so inotifywait is waiting for changes only on files which already exist. If you want to wait for changes on a directory, use . rather than ./*

Offline

#3 2025-11-05 13:52:35

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 70,964

Re: inotifywait does not print filename that edited

"Edit" might not end up being a modification if the file gets replaced w/ a new inode.

Offline

Board footer

Powered by FluxBB