Skip to Content
Linux Shell Scripting Cookbook - Third Edition
book

Linux Shell Scripting Cookbook - Third Edition

by Clif Flynt, Sarath Lakshman, Shantanu Tushar
May 2017
Beginner
552 pages
28h 47m
English
Packt Publishing
Content preview from Linux Shell Scripting Cookbook - Third Edition

How it works...

The previous script will log create, move, and delete events in the given path. The -m option causes watch to stay active and monitor changes continuously, rather than exiting after an event happens. The -r option enables a recursive watch of the directories (symbolic links are ignored). The -e option specifies the list of events to be watched and -q reduces the verbose messages and prints only the required ones. This output can be redirected to a log file.

The events that inotifywait can check include the following:

Event
Description

access

When a read happens to a file

modify

When file contents are modified

attrib

When metadata is changed

move

When a file undergoes a move operation

create ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Linux Shell Scripting - Second Edition

Mastering Linux Shell Scripting - Second Edition

Mokhtar Ebrahim, Andrew Mallett

Publisher Resources

ISBN: 9781785881985