how to monitor filesystem events on files and directories on linux

How to monitor filesystem events on files and directories on Linux

Inode notify (inotify) is a Linux kenel subsystem which provides APIs to to monitor filesystem events. Besides communicating with such APIs from proper programming languages, it is possible to take advantage of the exposed functionalities by using some explicitly designed command line tools such as inotifywait, which can be easily installed in all the major Linux distributions.

Read more

Linux EOF explained

Linux EOF explained

An EOF (end of file) condition is used to indicate the end of a file or data stream. It is a marker that tells the operating system it has reached the end of the data which it is reading. A Linux system utilizes an EOF marker whenever it is reading data, and users can also manually specify an EOF with various Linux commands like cat. In this tutorial, we will explain EOF in Linux and see examples of how to utilize it ourselves via the Heredoc function in Bash.

Read more

Linux xxd command explained

Linux xxd command explained

Once a program has been compiled, it is not easy to get a peek at the source code or to manipulate its behavior. But there is one thing we can do, which is look at the hexadecimal values inside the binary files. We can also make changes to the data and compile it back to a binary file. This will sometimes reveal information about a file, or allow us to modify its behavior if we can manage to edit the right bit.

Read more

Linux hard link vs. soft link

Linux hard link vs. soft link

Soft links and hard links are the two types of links that can be created on a Linux system. Without realizing it, you have undoubtedly interacted with tons of hard links on your own system. And, most likely, you have encountered some soft links (also called symbolic links or symlinks), too. That is because the files you work with on your system every day are either hard links or soft links that point to data on your hard drive. What we usually think of as a “file” is actually an inode that points to a data block on our hard drive, and the hard link is how we interact with it.

Read more

Getting started with toolbx

Getting started with Toolbx

Fedora Silverblue is an immutable variant of Fedora Workstation: every installation of this distribution is identical to the others, which is ideal for testing and predictability. On Fedora Silverblue, flatpaks are used as the primary method of installing software together with rpm-ostree which basically creates an additional layer over the immutable filesystem each time an rpm is installed. The toolbx utility is included in Fedora Silverblue as a way to create isolated, mutable environments using podman and the containers technology, allowing the user to install development tools and libraries without touching the main system. Toolbx can be used also on regular Fedora versions.

Read more

How to create a custom fedora live image

How to create a custom Fedora live image with Lorax

Fedora is one of the most popular Linux distributions: it is sponsored by Red Hat, but its development is community-driven. While the default version of Fedora ships with the GNOME desktop environment (it is probably the ideal choice if you want to use a vanilla version of the latter), there are many alternative spins available, which allows us to try a variety of desktop environments such as XFCE or KDE Plasma. In few easy steps it is even possible to build and try a custom Fedora live image.

Read more

How to format USB with exFAT on Linux

How to format USB with exFAT on Linux

exFAT stands for Extensible File Allocation Table and is a format made by Microsoft for use on devices like USB flash drives. In general, you do not hear a lot about exFAT these days, but it remains a viable format that is compatible with Windows, MacOS, and Linux, so it is a good choice for a flash drive that you plan on using with a variety of different systems. Some manufacturers even use exFAT as the default format for their SD cards or other products.

Read more

How to Disable Swap in Linux for Kubernetes

How to Disable Swap in Linux for Kubernetes

Part of the official requirements for Kubernetes is to disable swap space completely before attempting to launch Kubernetes. In some recent patch notes, Kubernetes has begun implementing support for swap space in some scenarios, but it is not fully supported. The official reason for not supporting swap space is because it is hard to predict how a pod might utilize memory when swap is enabled.

Read more

How to write a Bash script to run commands

Bash scripting is a powerful tool for automating complex tasks in Linux and Unix systems. One of the key features of bash scripting is the ability to run system commands within a script, enabling developers to automate repetitive tasks or complex workflows. In this article, we will explore the basic syntax and best practices for writing a bash script to run commands. Whether you’re a beginner or an intermediate-level bash programmer, this article will provide you with the foundational knowledge and skills to create robust and efficient scripts that can automate even the most complex tasks.

Read more

Resolving the 'No Space Left on Device' Error on Linux

Resolving the ‘No Space Left on Device’ Error on Linux

The No Space Left on Device error on a Linux system means that the partition you are trying to write data to or save files on lacks sufficient space for the operation. There are several things that users can do to resolve the error, all of which involve either freeing up additional space on the partition or extending the total size of available space. In this tutorial, we will show you how to resolve the No Space Left on Device, and go over some basic Linux commands that can help us to identify the problem.

Read more

Fixing the 'Too Many Open Files' Error on Linux

Fixing the ‘Too Many Open Files’ Error on Linux

Every Linux system imposes some upper limit on the number of files that can be opened simultaneously. If you exceed this limit, you will encounter the Too Many Open Files error. This is a security feature and failsafe to keep the system from becoming overwhelmed, since opening thousands of files is ordinarily unnecessary and indicative of a program gone haywire or a malicious user trying to crash the system.

Read more