inotify-tools
(sudo apt-get install inotify-tools
)inotifywait \ --monitor \ --event \ | while read -r WRITTEN_FILE EVENTS; do printf "%s was written\n" "${WRITTEN_FILE}"; done
In the above command replace as follows:
<EVENT>~: ~'CLOSE_WRITE'
for being notified when writing of the file has finished