Sometimes it is necessary to grant full user rights on an assortment of files in your Linux system. You may have dozens, hundreds, or even thousands of files on which a user needs read, write, and execute permissions in order to fully access and utilize them. In such scenarios, it can be useful to grant full user rights on an entire directory, which gives blanket permissions on all of the directory’s file contents and subdirectories.
File permissions on a Linux system can be represented in either symbolic mode or octal mode. Using octal mode to represent file permissions is a little more succinct, since we can usually list all relevant file permissions with just three numbers. These numbers represent the owner, group, and other user permissions for any file or directory on Linux. In this tutorial, you will see how to get a listing of file permissions in octal mode representation on the Linux command line.
GNU time is a really handy utility available in the repositories of every Linux distribution: we can use it to retrieve information about the “real”, “user”, and “system” execution times of a command, and, more generally, to check the amount of system resources used by it.
In this tutorial, we will see how to use Bash arrays and perform fundamental operations on them. Bash, the
Bourne Again Shell, is the default shell on practically all major Linux distributions: it is really powerful and can also be considered as a programming language, although not as sophisticated or feature-reach as Python or other “proper” languages. Furthermore, Bash scripting is a must-have skill for any Linux system administration job.
Are you receiving a
exit code 127 error when trying to execute a Bash script? This means that your Linux system was not able to find the command referenced inside of the script, which could indicate that the path to the command is not valid, or the command is not installed at all. In this tutorial, we’ll explain what causes this “command not found” error and show you how to fix it.
Every Linux system – including all Raspberry Pi models with Raspberry Pi OS installed – is running a Linux kernel, which serves as the foundation for a fully packaged operating system. As technology evolves, the Linux kernel receives updates to accommodate new hardware, features, and security patches. These updates grant the Raspberry Pi new abilities, or patch out problems that get reported and fixed with newer kernel versions.
Many users want their Raspberry Pi to perform tasks unattended, as part of automating the Raspberry Pi. This cuts down on repetitive tasks that usually fall on the administrator’s lap. A common way to trigger automatic events is when the Raspberry Pi first boots up. Such a configuration allows us to start a Bash script automatically every time the Raspberry Pi first boots up.
Even the most basic installation of any Linux distribution comes with a set of really useful utilities: “xargs” is undoubtedly one of those. By using xargs we can build and execute command lines using items from standard input as arguments of a command. This is especially useful when dealing with programs which don’t read standard input directly.
Documenting how an application works, its purpose, and its intended usage is really important, even if it is just a simple shell script we are talking about. To ease code maintenance in the most basic cases, documentation can be embed directly inside scripts. In this tutorial we learn how to include Pearl’s Plain Old Documentation syntax (POD) in bash scripts, and how to convert it to various formats using pod2 utilities such as pod2man and pod2html.
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.
The xclip tool can be used to interact with the system clipboard from the command line. This can come in handy in instances where you want to send information directly to the user’s clipboard, without requiring that they highlight and copy the text themselves. It also works in the other direction, so the
xclip command can check the contents of the clipboard.
Creating a bootable USB drive is often necessary when you want to install or repair an operating system. This guide provides detailed steps on how to create a bootable USB drive for Windows 10 or 11 using Linux (both Debian and RPM-based distributions).
Our handy script does all the heavy lifting, making this task a breeze. The script operates by formatting the USB drive, and then copying the ISO file to the USB drive.