{"id":4095,"date":"2022-12-20T17:39:22","date_gmt":"2022-12-20T20:39:22","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/inotify-man7\/"},"modified":"2022-12-20T17:39:22","modified_gmt":"2022-12-20T20:39:22","slug":"inotify-man7","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/inotify-man7\/","title":{"rendered":"INOTIFY (man7)"},"content":{"rendered":"<h1 align=\"center\">INOTIFY<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#VERSIONS\">VERSIONS<\/a><br \/> <a href=\"#CONFORMING TO\">CONFORMING TO<\/a><br \/> <a href=\"#NOTES\">NOTES<\/a><br \/> <a href=\"#BUGS\">BUGS<\/a><br \/> <a href=\"#EXAMPLES\">EXAMPLES<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#COLOPHON\">COLOPHON<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">inotify \u2212 monitoring filesystem events<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>inotify<\/i> API provides a mechanism for monitoring filesystem events. Inotify can be used to monitor individual files, or to monitor directories. When a directory is monitored, inotify will return events for the directory itself, and for files inside the directory.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The following system calls are used with this API:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"85%\">\n<p><b>inotify_init<\/b>(2) creates an inotify instance and returns a file descriptor referring to the inotify instance. The more recent <b>inotify_init1<\/b>(2) is like <b>inotify_init<\/b>(2), but has a <i>flags<\/i> argument that provides access to some extra functionality.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"85%\">\n<p><b>inotify_add_watch<\/b>(2) manipulates the &#8220;watch list&#8221; associated with an inotify instance. Each item (&#8220;watch&#8221;) in the watch list specifies the pathname of a file or directory, along with some set of events that the kernel should monitor for the file referred to by that pathname. <b>inotify_add_watch<\/b>(2) either creates a new watch item, or modifies an existing watch. Each watch has a unique &#8220;watch descriptor&#8221;, an integer returned by <b>inotify_add_watch<\/b>(2) when the watch is created.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"85%\">\n<p>When events occur for monitored files and directories, those events are made available to the application as structured data that can be read from the inotify file descriptor using <b>read<\/b>(2) (see below).<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"85%\">\n<p><b>inotify_rm_watch<\/b>(2) removes an item from an inotify watch list.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"85%\">\n<p>When all file descriptors referring to an inotify instance have been closed (using <b>close<\/b>(2)), the underlying object and its resources are freed for reuse by the kernel; all associated watches are automatically freed.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">With careful programming, an application can use inotify to efficiently monitor and cache the state of a set of filesystem objects. However, robust applications should allow for the fact that bugs in the monitoring logic or races of the kind described below may leave the cache inconsistent with the filesystem state. It is probably wise to do some consistency checking, and rebuild the cache when inconsistencies are detected.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Reading events from an inotify file descriptor<\/b> <br \/> To determine what events have occurred, an application <b>read<\/b>(2)s from the inotify file descriptor. If no events have so far occurred, then, assuming a blocking file descriptor, <b>read<\/b>(2) will block until at least one event occurs (unless interrupted by a signal, in which case the call fails with the error <b>EINTR<\/b>; see <b>signal<\/b>(7)).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Each successful <b>read<\/b>(2) returns a buffer containing one or more of the following structures:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">struct inotify_event { <br \/> int wd; \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var Watch descriptor bodies\/ usr\/ <br \/> uint32_t mask; \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var Mask describing event bodies\/ usr\/ <br \/> uint32_t cookie; \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var Unique cookie associating related <br \/> events (for rename(2)) bodies\/ usr\/ <br \/> uint32_t len; \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var Size of <i>name<\/i> field bodies\/ usr\/ <br \/> char name[]; \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var Optional null-terminated name bodies\/ usr\/ <br \/> };<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>wd<\/i> identifies the watch for which this event occurs. It is one of the watch descriptors returned by a previous call to <b>inotify_add_watch<\/b>(2).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>mask<\/i> contains bits that describe the event that occurred (see below).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>cookie<\/i> is a unique integer that connects related events. Currently, this is used only for rename events, and allows the resulting pair of <b>IN_MOVED_FROM<\/b> and <b>IN_MOVED_TO<\/b> events to be connected by the application. For all other event types, <i>cookie<\/i> is set to 0.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>name<\/i> field is present only when an event is returned for a file inside a watched directory; it identifies the filename within the watched directory. This filename is null-terminated, and may include further null bytes (&#8216;\u0000&#8217;) to align subsequent reads to a suitable address boundary.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>len<\/i> field counts all of the bytes in <i>name<\/i>, including the null bytes; the length of each <i>inotify_event<\/i> structure is thus <i>sizeof(struct inotify_event)+len<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The behavior when the buffer given to <b>read<\/b>(2) is too small to return information about the next event depends on the kernel version: in kernels before 2.6.21, <b>read<\/b>(2) returns 0; since kernel 2.6.21, <b>read<\/b>(2) fails with the error <b>EINVAL<\/b>. Specifying a buffer of size<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">sizeof(struct inotify_event) + NAME_MAX + 1<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">will be sufficient to read at least one event.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>inotify events<\/b> <br \/> The <b>inotify_add_watch<\/b>(2) <i>mask<\/i> argument and the <i>mask<\/i> field of the <i>inotify_event<\/i> structure returned when <b>read<\/b>(2)ing an inotify file descriptor are both bit masks identifying inotify events. The following bits can be specified in <i>mask<\/i> when calling <b>inotify_add_watch<\/b>(2) and may be returned in the <i>mask<\/i> field returned by <b>read<\/b>(2):<\/p>\n<p style=\"margin-left:17%;\"><b>IN_ACCESS<\/b> (+)<\/p>\n<p style=\"margin-left:28%;\">File was accessed (e.g., <b>read<\/b>(2), <b>execve<\/b>(2)).<\/p>\n<p style=\"margin-left:17%;\"><b>IN_ATTRIB<\/b> (*)<\/p>\n<p style=\"margin-left:28%;\">Metadata changed\u2014for example, permissions (e.g., <b>chmod<\/b>(2)), timestamps (e.g., <b>utimensat<\/b>(2)), extended attributes (<b>setxattr<\/b>(2)), link count (since Linux 2.6.25; e.g., for the target of <b>link<\/b>(2) and for <b>unlink<\/b>(2)), and user\/group ID (e.g., <b>chown<\/b>(2)).<\/p>\n<p style=\"margin-left:17%;\"><b>IN_CLOSE_WRITE<\/b> (+)<\/p>\n<p style=\"margin-left:28%;\">File opened for writing was closed.<\/p>\n<p style=\"margin-left:17%;\"><b>IN_CLOSE_NOWRITE<\/b> (*)<\/p>\n<p style=\"margin-left:28%;\">File or directory not opened for writing was closed.<\/p>\n<p style=\"margin-left:17%;\"><b>IN_CREATE<\/b> (+)<\/p>\n<p style=\"margin-left:28%;\">File\/directory created in watched directory (e.g., <b>open<\/b>(2) <b>O_CREAT<\/b>, <b>mkdir<\/b>(2), <b>link<\/b>(2), <b>symlink<\/b>(2), <b>bind<\/b>(2) on a UNIX domain socket).<\/p>\n<p style=\"margin-left:17%;\"><b>IN_DELETE<\/b> (+)<\/p>\n<p style=\"margin-left:28%;\">File\/directory deleted from watched directory.<\/p>\n<p style=\"margin-left:17%;\"><b>IN_DELETE_SELF<\/b><\/p>\n<p style=\"margin-left:28%;\">Watched file\/directory was itself deleted. (This event also occurs if an object is moved to another filesystem, since <b>mv<\/b>(1) in effect copies the file to the other filesystem and then deletes it from the original filesystem.) In addition, an <b>IN_IGNORED<\/b> event will subsequently be generated for the watch descriptor.<\/p>\n<p style=\"margin-left:17%;\"><b>IN_MODIFY<\/b> (+)<\/p>\n<p style=\"margin-left:28%;\">File was modified (e.g., <b>write<\/b>(2), <b>truncate<\/b>(2)).<\/p>\n<p style=\"margin-left:17%;\"><b>IN_MOVE_SELF<\/b><\/p>\n<p style=\"margin-left:28%;\">Watched file\/directory was itself moved.<\/p>\n<p style=\"margin-left:17%;\"><b>IN_MOVED_FROM<\/b> (+)<\/p>\n<p style=\"margin-left:28%;\">Generated for the directory containing the old filename when a file is renamed.<\/p>\n<p style=\"margin-left:17%;\"><b>IN_MOVED_TO<\/b> (+)<\/p>\n<p style=\"margin-left:28%;\">Generated for the directory containing the new filename when a file is renamed.<\/p>\n<p style=\"margin-left:17%;\"><b>IN_OPEN<\/b> (*)<\/p>\n<p style=\"margin-left:28%;\">File or directory was opened.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Inotify monitoring is inode-based: when monitoring a file (but not when monitoring the directory containing a file), an event can be generated for activity on any link to the file (in the same or a different directory).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When monitoring a directory:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"85%\">\n<p>the events marked above with an asterisk (*) can occur both for the directory itself and for objects inside the directory; and<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"85%\">\n<p>the events marked with a plus sign (+) occur only for objects inside the directory (not for the directory itself).<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>Note<\/i>: when monitoring a directory, events are not generated for the files inside the directory when the events are performed via a pathname (i.e., a link) that lies outside the monitored directory.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When events are generated for objects inside a watched directory, the <i>name<\/i> field in the returned <i>inotify_event<\/i> structure identifies the name of the file within the directory.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>IN_ALL_EVENTS<\/b> macro is defined as a bit mask of all of the above events. This macro can be used as the <i>mask<\/i> argument when calling <b>inotify_add_watch<\/b>(2).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Two additional convenience macros are defined:<\/p>\n<p style=\"margin-left:17%;\"><b>IN_MOVE<\/b><\/p>\n<p style=\"margin-left:28%;\">Equates to <b>IN_MOVED_FROM | IN_MOVED_TO<\/b>.<\/p>\n<p style=\"margin-left:17%;\"><b>IN_CLOSE<\/b><\/p>\n<p style=\"margin-left:28%;\">Equates to <b>IN_CLOSE_WRITE | IN_CLOSE_NOWRITE<\/b>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The following further bits can be specified in <i>mask<\/i> when calling <b>inotify_add_watch<\/b>(2):<\/p>\n<p style=\"margin-left:17%;\"><b>IN_DONT_FOLLOW<\/b> (since Linux 2.6.15)<\/p>\n<p style=\"margin-left:28%;\">Don\u2019t dereference <i>pathname<\/i> if it is a symbolic link.<\/p>\n<p style=\"margin-left:17%;\"><b>IN_EXCL_UNLINK<\/b> (since Linux 2.6.36)<\/p>\n<p style=\"margin-left:28%;\">By default, when watching events on the children of a directory, events are generated for children even after they have been unlinked from the directory. This can result in large numbers of uninteresting events for some applications (e.g., if watching <i>\/tmp<\/i>, in which many applications create temporary files whose names are immediately unlinked). Specifying <b>IN_EXCL_UNLINK<\/b> changes the default behavior, so that events are not generated for children after they have been unlinked from the watched directory.<\/p>\n<p style=\"margin-left:17%;\"><b>IN_MASK_ADD<\/b><\/p>\n<p style=\"margin-left:28%;\">If a watch instance already exists for the filesystem object corresponding to <i>pathname<\/i>, add (OR) the events in <i>mask<\/i> to the watch mask (instead of replacing the mask); the error <b>EINVAL<\/b> results if <b>IN_MASK_CREATE<\/b> is also specified.<\/p>\n<p style=\"margin-left:17%;\"><b>IN_ONESHOT<\/b><\/p>\n<p style=\"margin-left:28%;\">Monitor the filesystem object corresponding to <i>pathname<\/i> for one event, then remove from watch list.<\/p>\n<p style=\"margin-left:17%;\"><b>IN_ONLYDIR<\/b> (since Linux 2.6.15)<\/p>\n<p style=\"margin-left:28%;\">Watch <i>pathname<\/i> only if it is a directory; the error <b>ENOTDIR<\/b> results if <i>pathname<\/i> is not a directory. Using this flag provides an application with a race-free way of ensuring that the monitored object is a directory.<\/p>\n<p style=\"margin-left:17%;\"><b>IN_MASK_CREATE<\/b> (since Linux 4.18)<\/p>\n<p style=\"margin-left:28%;\">Watch <i>pathname<\/i> only if it does not already have a watch associated with it; the error <b>EEXIST<\/b> results if <i>pathname<\/i> is already being watched.<\/p>\n<p style=\"margin-left:28%; margin-top: 1em\">Using this flag provides an application with a way of ensuring that new watches do not modify existing ones. This is useful because multiple paths may refer to the same inode, and multiple calls to <b>inotify_add_watch<\/b>(2) without this flag may clobber existing watch masks.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The following bits may be set in the <i>mask<\/i> field returned by <b>read<\/b>(2):<\/p>\n<p style=\"margin-left:17%;\"><b>IN_IGNORED<\/b><\/p>\n<p style=\"margin-left:28%;\">Watch was removed explicitly (<b>inotify_rm_watch<\/b>(2)) or automatically (file was deleted, or filesystem was unmounted). See also BUGS.<\/p>\n<p style=\"margin-left:17%;\"><b>IN_ISDIR<\/b><\/p>\n<p style=\"margin-left:28%;\">Subject of this event is a directory.<\/p>\n<p style=\"margin-left:17%;\"><b>IN_Q_OVERFLOW<\/b><\/p>\n<p style=\"margin-left:28%;\">Event queue overflowed (<i>wd<\/i> is \u22121 for this event).<\/p>\n<p style=\"margin-left:17%;\"><b>IN_UNMOUNT<\/b><\/p>\n<p style=\"margin-left:28%;\">Filesystem containing watched object was unmounted. In addition, an <b>IN_IGNORED<\/b> event will subsequently be generated for the watch descriptor.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Examples<\/b> <br \/> Suppose an application is watching the directory <i>dir<\/i> and the file <i>dir\/myfile<\/i> for all events. The examples below show some events that will be generated for these two objects.<\/p>\n<p style=\"margin-left:17%;\">fd = open(&#8220;dir\/myfile&#8221;, O_RDWR);<\/p>\n<p style=\"margin-left:28%;\">Generates <b>IN_OPEN<\/b> events for both <i>dir<\/i> and <i>dir\/myfile<\/i>.<\/p>\n<p style=\"margin-left:17%;\">read(fd, buf, count);<\/p>\n<p style=\"margin-left:28%;\">Generates <b>IN_ACCESS<\/b> events for both <i>dir<\/i> and <i>dir\/myfile<\/i>.<\/p>\n<p style=\"margin-left:17%;\">write(fd, buf, count);<\/p>\n<p style=\"margin-left:28%;\">Generates <b>IN_MODIFY<\/b> events for both <i>dir<\/i> and <i>dir\/myfile<\/i>.<\/p>\n<p style=\"margin-left:17%;\">fchmod(fd, mode);<\/p>\n<p style=\"margin-left:28%;\">Generates <b>IN_ATTRIB<\/b> events for both <i>dir<\/i> and <i>dir\/myfile<\/i>.<\/p>\n<p style=\"margin-left:17%;\">close(fd);<\/p>\n<p style=\"margin-left:28%;\">Generates <b>IN_CLOSE_WRITE<\/b> events for both <i>dir<\/i> and <i>dir\/myfile<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Suppose an application is watching the directories <i>dir1<\/i> and <i>dir2<\/i>, and the file <i>dir1\/myfile<\/i>. The following examples show some events that may be generated.<\/p>\n<p style=\"margin-left:17%;\">link(&#8220;dir1\/myfile&#8221;, &#8220;dir2\/new&#8221;);<\/p>\n<p style=\"margin-left:28%;\">Generates an <b>IN_ATTRIB<\/b> event for <i>myfile<\/i> and an <b>IN_CREATE<\/b> event for <i>dir2<\/i>.<\/p>\n<p style=\"margin-left:17%;\">rename(&#8220;dir1\/myfile&#8221;, &#8220;dir2\/myfile&#8221;);<\/p>\n<p style=\"margin-left:28%;\">Generates an <b>IN_MOVED_FROM<\/b> event for <i>dir1<\/i>, an <b>IN_MOVED_TO<\/b> event for <i>dir2<\/i>, and an <b>IN_MOVE_SELF<\/b> event for <i>myfile<\/i>. The <b>IN_MOVED_FROM<\/b> and <b>IN_MOVED_TO<\/b> events will have the same <i>cookie<\/i> value.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Suppose that <i>dir1\/xx<\/i> and <i>dir2\/yy<\/i> are (the only) links to the same file, and an application is watching <i>dir1<\/i>, <i>dir2<\/i>, <i>dir1\/xx<\/i>, and <i>dir2\/yy<\/i>. Executing the following calls in the order given below will generate the following events:<\/p>\n<p style=\"margin-left:17%;\">unlink(&#8220;dir2\/yy&#8221;);<\/p>\n<p style=\"margin-left:28%;\">Generates an <b>IN_ATTRIB<\/b> event for <i>xx<\/i> (because its link count changes) and an <b>IN_DELETE<\/b> event for <i>dir2<\/i>.<\/p>\n<p style=\"margin-left:17%;\">unlink(&#8220;dir1\/xx&#8221;);<\/p>\n<p style=\"margin-left:28%;\">Generates <b>IN_ATTRIB<\/b>, <b>IN_DELETE_SELF<\/b>, and <b>IN_IGNORED<\/b> events for <i>xx<\/i>, and an <b>IN_DELETE<\/b> event for <i>dir1<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Suppose an application is watching the directory <i>dir<\/i> and (the empty) directory <i>dir\/subdir<\/i>. The following examples show some events that may be generated.<\/p>\n<p style=\"margin-left:17%;\">mkdir(&#8220;dir\/new&#8221;, mode);<\/p>\n<p style=\"margin-left:28%;\">Generates an <b>IN_CREATE | IN_ISDIR<\/b> event for <i>dir<\/i>.<\/p>\n<p style=\"margin-left:17%;\">rmdir(&#8220;dir\/subdir&#8221;);<\/p>\n<p style=\"margin-left:28%;\">Generates <b>IN_DELETE_SELF<\/b> and <b>IN_IGNORED<\/b> events for <i>subdir<\/i>, and an <b>IN_DELETE | IN_ISDIR<\/b> event for <i>dir<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\/proc interfaces<\/b> <br \/> The following interfaces can be used to limit the amount of kernel memory consumed by inotify: <i><br \/> \/proc\/sys\/fs\/inotify\/max_queued_events<\/i><\/p>\n<p style=\"margin-left:22%;\">The value in this file is used when an application calls <b>inotify_init<\/b>(2) to set an upper limit on the number of events that can be queued to the corresponding inotify instance. Events in excess of this limit are dropped, but an <b>IN_Q_OVERFLOW<\/b> event is always generated.<\/p>\n<p style=\"margin-left:11%;\"><i>\/proc\/sys\/fs\/inotify\/max_user_instances<\/i><\/p>\n<p style=\"margin-left:22%;\">This specifies an upper limit on the number of inotify instances that can be created per real user ID.<\/p>\n<p style=\"margin-left:11%;\"><i>\/proc\/sys\/fs\/inotify\/max_user_watches<\/i><\/p>\n<p style=\"margin-left:22%;\">This specifies an upper limit on the number of watches that can be created per real user ID.<\/p>\n<h2>VERSIONS <a name=\"VERSIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Inotify was merged into the 2.6.13 Linux kernel. The required library interfaces were added to glibc in version 2.4. (<b>IN_DONT_FOLLOW<\/b>, <b>IN_MASK_ADD<\/b>, and <b>IN_ONLYDIR<\/b> were added in glibc version 2.5.)<\/p>\n<h2>CONFORMING TO <a name=\"CONFORMING TO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The inotify API is Linux-specific.<\/p>\n<h2>NOTES <a name=\"NOTES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Inotify file descriptors can be monitored using <b>select<\/b>(2), <b>poll<\/b>(2), and <b>epoll<\/b>(7). When an event is available, the file descriptor indicates as readable.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Since Linux 2.6.25, signal-driven I\/O notification is available for inotify file descriptors; see the discussion of <b>F_SETFL<\/b> (for setting the <b>O_ASYNC<\/b> flag), <b>F_SETOWN<\/b>, and <b>F_SETSIG<\/b> in <b>fcntl<\/b>(2). The <i>siginfo_t<\/i> structure (described in <b>sigaction<\/b>(2)) that is passed to the signal handler has the following fields set: <i>si_fd<\/i> is set to the inotify file descriptor number; <i>si_signo<\/i> is set to the signal number; <i>si_code<\/i> is set to <b>POLL_IN<\/b>; and <b>POLLIN<\/b> is set in <i>si_band<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If successive output inotify events produced on the inotify file descriptor are identical (same <i>wd<\/i>, <i>mask<\/i>, <i>cookie<\/i>, and <i>name<\/i>), then they are coalesced into a single event if the older event has not yet been read (but see BUGS). This reduces the amount of kernel memory required for the event queue, but also means that an application can\u2019t use inotify to reliably count file events.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The events returned by reading from an inotify file descriptor form an ordered queue. Thus, for example, it is guaranteed that when renaming from one directory to another, events will be produced in the correct order on the inotify file descriptor.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The set of watch descriptors that is being monitored via an inotify file descriptor can be viewed via the entry for the inotify file descriptor in the process\u2019s <i>\/proc\/[pid]\/fdinfo<\/i> directory. See <b>proc<\/b>(5) for further details. The <b>FIONREAD ioctl<\/b>(2) returns the number of bytes available to read from an inotify file descriptor.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Limitations and caveats<\/b> <br \/> The inotify API provides no information about the user or process that triggered the inotify event. In particular, there is no easy way for a process that is monitoring events via inotify to distinguish events that it triggers itself from those that are triggered by other processes.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Inotify reports only events that a user-space program triggers through the filesystem API. As a result, it does not catch remote events that occur on network filesystems. (Applications must fall back to polling the filesystem to catch such events.) Furthermore, various pseudo-filesystems such as <i>\/proc<\/i>, <i>\/sys<\/i>, and <i>\/dev\/pts<\/i> are not monitorable with inotify.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The inotify API does not report file accesses and modifications that may occur because of <b>mmap<\/b>(2), <b>msync<\/b>(2), and <b>munmap<\/b>(2).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The inotify API identifies affected files by filename. However, by the time an application processes an inotify event, the filename may already have been deleted or renamed.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The inotify API identifies events via watch descriptors. It is the application\u2019s responsibility to cache a mapping (if one is needed) between watch descriptors and pathnames. Be aware that directory renamings may affect multiple cached pathnames.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Inotify monitoring of directories is not recursive: to monitor subdirectories under a directory, additional watches must be created. This can take a significant amount time for large directory trees.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If monitoring an entire directory subtree, and a new subdirectory is created in that tree or an existing directory is renamed into that tree, be aware that by the time you create a watch for the new subdirectory, new files (and subdirectories) may already exist inside the subdirectory. Therefore, you may want to scan the contents of the subdirectory immediately after adding the watch (and, if desired, recursively add watches for any subdirectories that it contains).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Note that the event queue can overflow. In this case, events are lost. Robust applications should handle the possibility of lost events gracefully. For example, it may be necessary to rebuild part or all of the application cache. (One simple, but possibly expensive, approach is to close the inotify file descriptor, empty the cache, create a new inotify file descriptor, and then re-create watches and cache entries for the objects to be monitored.)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If a filesystem is mounted on top of a monitored directory, no event is generated, and no events are generated for objects immediately under the new mount point. If the filesystem is subsequently unmounted, events will subsequently be generated for the directory and the objects it contains.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Dealing with rename() events<\/b> <br \/> As noted above, the <b>IN_MOVED_FROM<\/b> and <b>IN_MOVED_TO<\/b> event pair that is generated by <b>rename<\/b>(2) can be matched up via their shared cookie value. However, the task of matching has some challenges.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">These two events are usually consecutive in the event stream available when reading from the inotify file descriptor. However, this is not guaranteed. If multiple processes are triggering events for monitored objects, then (on rare occasions) an arbitrary number of other events may appear between the <b>IN_MOVED_FROM<\/b> and <b>IN_MOVED_TO<\/b> events. Furthermore, it is not guaranteed that the event pair is atomically inserted into the queue: there may be a brief interval where the <b>IN_MOVED_FROM<\/b> has appeared, but the <b>IN_MOVED_TO<\/b> has not.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Matching up the <b>IN_MOVED_FROM<\/b> and <b>IN_MOVED_TO<\/b> event pair generated by <b>rename<\/b>(2) is thus inherently racy. (Don\u2019t forget that if an object is renamed outside of a monitored directory, there may not even be an <b>IN_MOVED_TO<\/b> event.) Heuristic approaches (e.g., assume the events are always consecutive) can be used to ensure a match in most cases, but will inevitably miss some cases, causing the application to perceive the <b>IN_MOVED_FROM<\/b> and <b>IN_MOVED_TO<\/b> events as being unrelated. If watch descriptors are destroyed and re-created as a result, then those watch descriptors will be inconsistent with the watch descriptors in any pending events. (Re-creating the inotify file descriptor and rebuilding the cache may be useful to deal with this scenario.)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Applications should also allow for the possibility that the <b>IN_MOVED_FROM<\/b> event was the last event that could fit in the buffer returned by the current call to <b>read<\/b>(2), and the accompanying <b>IN_MOVED_TO<\/b> event might be fetched only on the next <b>read<\/b>(2), which should be done with a (small) timeout to allow for the fact that insertion of the <b>IN_MOVED_FROM<\/b>&#8211;<b>IN_MOVED_TO<\/b> event pair is not atomic, and also the possibility that there may not be any <b>IN_MOVED_TO<\/b> event.<\/p>\n<h2>BUGS <a name=\"BUGS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Before Linux 3.19, <b>fallocate<\/b>(2) did not create any inotify events. Since Linux 3.19, calls to <b>fallocate<\/b>(2) generate <b>IN_MODIFY<\/b> events.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">In kernels before 2.6.16, the <b>IN_ONESHOT<\/b> <i>mask<\/i> flag does not work.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">As originally designed and implemented, the <b>IN_ONESHOT<\/b> flag did not cause an <b>IN_IGNORED<\/b> event to be generated when the watch was dropped after one event. However, as an unintended effect of other changes, since Linux 2.6.36, an <b>IN_IGNORED<\/b> event is generated in this case.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Before kernel 2.6.25, the kernel code that was intended to coalesce successive identical events (i.e., the two most recent events could potentially be coalesced if the older had not yet been read) instead checked if the most recent event could be coalesced with the <i>oldest<\/i> unread event.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When a watch descriptor is removed by calling <b>inotify_rm_watch<\/b>(2) (or because a watch file is deleted or the filesystem that contains it is unmounted), any pending unread events for that watch descriptor remain available to read. As watch descriptors are subsequently allocated with <b>inotify_add_watch<\/b>(2), the kernel cycles through the range of possible watch descriptors (0 to <b>INT_MAX<\/b>) incrementally. When allocating a free watch descriptor, no check is made to see whether that watch descriptor number has any pending unread events in the inotify queue. Thus, it can happen that a watch descriptor is reallocated even when pending unread events exist for a previous incarnation of that watch descriptor number, with the result that the application might then read those events and interpret them as belonging to the file associated with the newly recycled watch descriptor. In practice, the likelihood of hitting this bug may be extremely low, since it requires that an application cycle through <b>INT_MAX<\/b> watch descriptors, release a watch descriptor while leaving unread events for that watch descriptor in the queue, and then recycle that watch descriptor. For this reason, and because there have been no reports of the bug occurring in real-world applications, as of Linux 3.15, no kernel changes have yet been made to eliminate this possible bug.<\/p>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The following program demonstrates the usage of the inotify API. It marks the directories passed as a command-line arguments and waits for events of type <b>IN_OPEN<\/b>, <b>IN_CLOSE_NOWRITE<\/b>, and <b>IN_CLOSE_WRITE<\/b>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The following output was recorded while editing the file <i>\/home\/user\/temp\/foo<\/i> and listing directory <i>\/tmp<\/i>. Before the file and the directory were opened, <b>IN_OPEN<\/b> events occurred. After the file was closed, an <b>IN_CLOSE_WRITE<\/b> event occurred. After the directory was closed, an <b>IN_CLOSE_NOWRITE<\/b> event occurred. Execution of the program ended when the user pressed the ENTER key.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Example output<\/b><\/p>\n<p style=\"margin-left:17%;\">$ <b>.\/a.out \/tmp \/home\/user\/temp<\/b> <br \/> Press enter key to terminate. <br \/> Listening for events. <br \/> IN_OPEN: \/home\/user\/temp\/foo [file] <br \/> IN_CLOSE_WRITE: \/home\/user\/temp\/foo [file] <br \/> IN_OPEN: \/tmp\/ [directory] <br \/> IN_CLOSE_NOWRITE: \/tmp\/ [directory]<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Listening for events stopped.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Program source<\/b> <br \/> #include <errno.h> <br \/> #include <poll.h> #include <stdio.h> <br \/> #include <stdlib.h> <br \/> #include <sys\/inotify.h> <br \/> #include <unistd.h> <br \/> #include <string.h><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/* Read all available inotify events from the file descriptor &#8216;fd&#8217;. <br \/> wd is the table of watch descriptors for the directories in argv. <br \/> argc is the length of wd and argv. <br \/> argv is the list of watched directories. <br \/> Entry 0 of wd and argv is unused. *\/<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">static void <br \/> handle_events(int fd, int *wd, int argc, char* argv[]) <br \/> { <br \/> \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var Some systems cannot read integer variables if they are not <br \/> properly aligned. On other systems, incorrect alignment may <br \/> decrease performance. Hence, the buffer used for reading from <br \/> the inotify file descriptor should have the same alignment as <br \/> struct inotify_event. *\/<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">char buf[4096] <br \/> __attribute__ ((aligned(__alignof__(struct inotify_event)))); <br \/> const struct inotify_event *event; <br \/> ssize_t len;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/* Loop while events can be read from inotify file descriptor. *\/<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">for (;;) {<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/* Read some events. *\/<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">len = read(fd, buf, sizeof(buf)); <br \/> if (len == \u22121 &#038;&#038; errno != EAGAIN) { <br \/> perror(&#8220;read&#8221;); <br \/> exit(EXIT_FAILURE); <br \/> }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/* If the nonblocking read() found no events to read, then <br \/> it returns \u22121 with errno set to EAGAIN. In that case, <br \/> we exit the loop. *\/<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">if (len <= 0) <br \/> break;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/* Loop over all events in the buffer *\/<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">for (char *ptr = buf; ptr < buf + len; <br \/> ptr += sizeof(struct inotify_event) + event\u2212>len) {<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">event = (const struct inotify_event *) ptr;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/* Print event type *\/<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">if (event\u2212>mask &#038; IN_OPEN) <br \/> printf(&#8220;IN_OPEN: &#8220;); <br \/> if (event\u2212>mask &#038; IN_CLOSE_NOWRITE) <br \/> printf(&#8220;IN_CLOSE_NOWRITE: &#8220;); <br \/> if (event\u2212>mask &#038; IN_CLOSE_WRITE) <br \/> printf(&#8220;IN_CLOSE_WRITE: &#8220;);<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/* Print the name of the watched directory *\/<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">for (int i = 1; i < argc; ++i) { <br \/> if (wd[i] == event\u2212>wd) { <br \/> printf(&#8220;%s\/&#8221;, argv[i]); <br \/> break; <br \/> } <br \/> }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/* Print the name of the file *\/<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">if (event\u2212>len) <br \/> printf(&#8220;%s&#8221;, event\u2212>name);<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/* Print type of filesystem object *\/<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">if (event\u2212>mask &#038; IN_ISDIR) <br \/> printf(&#8221; [directory]n&#8221;); <br \/> else <br \/> printf(&#8221; [file]n&#8221;); <br \/> } <br \/> } <br \/> }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">int <br \/> main(int argc, char* argv[]) <br \/> { <br \/> char buf; <br \/> int fd, i, poll_num; <br \/> int *wd; <br \/> nfds_t nfds; <br \/> struct pollfd fds[2];<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">if (argc < 2) { <br \/> printf(&#8220;Usage: %s PATH [PATH &#8230;]n&#8221;, argv[0]); <br \/> exit(EXIT_FAILURE); <br \/> }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">printf(&#8220;Press ENTER key to terminate.n&#8221;);<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/* Create the file descriptor for accessing the inotify API *\/<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">fd = inotify_init1(IN_NONBLOCK); <br \/> if (fd == \u22121) { <br \/> perror(&#8220;inotify_init1&#8221;); <br \/> exit(EXIT_FAILURE); <br \/> }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/* Allocate memory for watch descriptors *\/<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">wd = calloc(argc, sizeof(int)); <br \/> if (wd == NULL) { <br \/> perror(&#8220;calloc&#8221;); <br \/> exit(EXIT_FAILURE); <br \/> }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/* Mark directories for events <br \/> \u2212 file was opened <br \/> \u2212 file was closed *\/<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">for (i = 1; i < argc; i++) { <br \/> wd[i] = inotify_add_watch(fd, argv[i], <br \/> IN_OPEN | IN_CLOSE); <br \/> if (wd[i] == \u22121) { <br \/> fprintf(stderr, &#8220;Cannot watch &#8216;%s&#8217;: %sn&#8221;, <br \/> argv[i], strerror(errno)); <br \/> exit(EXIT_FAILURE); <br \/> } <br \/> }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/* Prepare for polling *\/<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">nfds = 2;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/* Console input *\/<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">fds[0].fd = STDIN_FILENO; <br \/> fds[0].events = POLLIN;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/* Inotify input *\/<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">fds[1].fd = fd; <br \/> fds[1].events = POLLIN;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/* Wait for events and\/or terminal input *\/<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">printf(&#8220;Listening for events.n&#8221;); <br \/> while (1) { <br \/> poll_num = poll(fds, nfds, \u22121); <br \/> if (poll_num == \u22121) { <br \/> if (errno == EINTR) <br \/> continue; <br \/> perror(&#8220;poll&#8221;); <br \/> exit(EXIT_FAILURE); <br \/> }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">if (poll_num > 0) {<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">if (fds[0].revents &#038; POLLIN) {<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/* Console input is available. Empty stdin and quit *\/<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">while (read(STDIN_FILENO, &#038;buf, 1) > 0 &#038;&#038; buf != &#8216;n&#8217;) <br \/> continue; <br \/> break; <br \/> }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">if (fds[1].revents &#038; POLLIN) {<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/* Inotify events are available *\/<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">handle_events(fd, wd, argc, argv); <br \/> } <br \/> } <br \/> }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">printf(&#8220;Listening for events stopped.n&#8221;);<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/* Close inotify file descriptor *\/<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">close(fd);<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">free(wd); <br \/> exit(EXIT_SUCCESS); <br \/> }<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>inotifywait<\/b>(1), <b>inotifywatch<\/b>(1), <b>inotify_add_watch<\/b>(2), <b>inotify_init<\/b>(2), <b>inotify_init1<\/b>(2), <b>inotify_rm_watch<\/b>(2), <b>read<\/b>(2), <b>stat<\/b>(2), <b>fanotify<\/b>(7)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>Documentation\/filesystems\/inotify.txt<\/i> in the Linux kernel source tree<\/p>\n<h2>COLOPHON <a name=\"COLOPHON\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This page is part of release 5.10 of the Linux <i>man-pages<\/i> project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https:\/\/www.kernel.org\/doc\/man\u2212pages\/.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  inotify \u2212 monitoring filesystem events <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[971],"tags":[973,1174,972],"class_list":["post-4095","post","type-post","status-publish","format-standard","hentry","category-7-miscelanea","tag-973","tag-inotify","tag-man7"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4095","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=4095"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4095\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=4095"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=4095"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=4095"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}