Retrieving File Permissions in Octal Mode Using the Command Line

Retrieving File Permissions in Octal Mode Using the Command Line

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.

Read more

How to use bash array in a shell script

How to use bash array in a shell script

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.

Read more

Exit code 127 error status in Bash script

Exit code 127 error status in Bash script

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.

Read more

How to check kernel version on Raspberry Pi

How to check kernel version on Raspberry Pi

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.

Read more

How to autostart Bash script on startup on Raspberry Pi

How to autostart Bash script on startup on Raspberry Pi

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.

Read more

How to build command lines from standard input with xargs

How to use xargs to build command lines from standard input

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.

Read more

How to embed documentation in shell scripts using Pearl's Plain Old Documentation syntax

How to embed documentation in Bash scripts

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.

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

How to use xclip on Linux

How to use xclip on Linux

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.

Read more

Creating a Bootable USB for Windows 10 and 11 on Linux

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.

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