How To Install inotify-tools on Debian 12
Introduction
In this tutorial we learn how to install inotify-tools
on Debian 12.
What is inotify-tools
inotify-tools is:
inotify (inode notify) is a Linux kernel subsystem that monitors events in filesystems and reports those events to applications in real time via API.
inotify can be used to monitor individual files or directories. When a directory is monitored, inotify will return events for the directory itself and for files inside the directory.
inotify-tools is a set of command-line programs for Linux providing a simple interface to inotify. These programs can be used to monitor and act upon filesystem events. inotify-tools consists of four utilities: inotifywait, inotifywatch, fsnotifywait and fsnotifywatch.
inotifywait efficiently waits for changes to files, making it appropriate for use in shell scripts.
inotifywatch collects filesystem usage statistics and outputs counts of each inotify event.
fsnotifywait and fsnotifywatch are similar to inotifywait and inotifywatch, but they are using Linux’s fanotify(7) interface by default. The fanotify API also provides notification and interception of filesystem events. Additional capabilities compared to the inotify(7) API include the ability to monitor all of the objects in a mounted filesystem, the ability to make access permission decisions, and the possibility to read or modify files before access by other applications.
inotify-tools is also useful for security activities in firewall systems or to detect changes and injections of new files in webservers by intruders.
There are three methods to install inotify-tools
on Debian 12. We can use apt-get
, apt
and aptitude
. In the following sections we will describe each method. You can choose one of them.
Install inotify-tools Using apt-get
Update apt database with apt-get
using the following command.
sudo apt-get update
After updating apt database, We can install inotify-tools
using apt-get
by running the following command:
sudo apt-get -y install inotify-tools
Install inotify-tools Using apt
Update apt database with apt
using the following command.
sudo apt update
After updating apt database, We can install inotify-tools
using apt
by running the following command:
sudo apt -y install inotify-tools
Install inotify-tools Using aptitude
If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude
using the following command.
sudo aptitude update
After updating apt database, We can install inotify-tools
using aptitude
by running the following command:
sudo aptitude -y install inotify-tools
How To Uninstall inotify-tools on Debian 12
To uninstall only the inotify-tools
package we can use the following command:
sudo apt-get remove inotify-tools
Uninstall inotify-tools And Its Dependencies
To uninstall inotify-tools
and its dependencies that are no longer needed by Debian 12, we can use the command below:
sudo apt-get -y autoremove inotify-tools
Remove inotify-tools Configurations and Data
To remove inotify-tools
configuration and data from Debian 12 we can use the following command:
sudo apt-get -y purge inotify-tools
Remove inotify-tools configuration, data, and all of its dependencies
We can use the following command to remove inotify-tools
configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge inotify-tools
Dependencies
inotify-tools have the following dependencies:
References
Summary
In this tutorial we learn how to install inotify-tools
package on Debian 12 using different package management tools: apt
, apt-get
and aptitude
.