Using GNU screen with examples

Using GNU screen with examples

Have you even been in the situation where you were running a 3 hour copy or script on a remote machine, only to find that it broke at 2h 45min because your network connection or SSH connection dropped momentarily? If so, you know how painful that feels 🙂 Welcome to GNU screen, the utility which allows you to start a separate shell which will not be interrupted if your network connection breaks. Read on to discover how to use it and more!

In this tutorial you will learn:

  • How to install and use the GNU screen utility
  • How to configure the GNU screen utility to function better
  • Basic usage examples on how to use the GNU screen utility from the Bash command line

Read more

How to update CentOS

How to update CentOS

Like all Linux distros, it’s important to keep your CentOS system up to date in order to make sure that you have the latest security updates and newest features. Updating the system usually involves simply upgrading all installed packages to their latest versions. Every few years, there’s a new version of CentOS released, which requires a more involved update process to install.

In this article, we’ll cover updating a CentOS system on a per package basis and upgrading the entire operating system. This can be done via command line and GUI. Both methods will be shown in this guide, so you can pick whichever is easier for you.

The process for upgrading a CentOS system is a little different depending on which version you have installed. The latest version of Centos has moved to the dnf package manager. Previous to Centos 8, yum was the package manager used. Regardless of which version you’re running, we’ll show you the proper commands so you can update your system.

In this tutorial you will learn:

  • How to update CentOS packages via command line
  • How to update CentOS packages via GUI
  • How to upgrade entire CentOS system

Read more

List of users on a Linux system

How to list users on Linux

User management is an important part of Linux administration, so it’s essential to know about all the user accounts on a Linux system and how to disable user accounts, etc. In this guide, we’ll show you how to list the current users via command line and GUI. This will include a GNOME desktop environment as well as KDE.

In this tutorial you will learn:

  • How to list users via command line
  • How to list users on GNOME GUI
  • How to list users on KDE GUI

Read more

How to trace system calls made by a process with strace on Linux

How to trace system calls made by a process with strace on Linux

There are times when it’s useful to inspect what a running application is doing under the hood, and what system calls it is performing during its execution. To accomplish such a task on Linux, we can use the strace utility. In this article we will see how to install it and we will learn its basic usage.

In this tutorial you will learn:

  • How to install strace
  • How to use strace to trace system calls made by a process
  • How to filter specifics system calls
  • How to attach to an already running process
  • How to generate a system call summary

Read more

systemd-logo

Introduction to the Systemd journal

Systemd is nowadays the init system adopted by almost all Linux distributions, from Red Hat Enterprise Linux to Debian and Ubuntu. One of the things that made Systemd the target of a lot of critics is that it tries to be a lot more than a simple init system and tries to re-invent some Linux subsystems.

The traditional logging system used on Linux, for example was rsyslog, a modern version of the traditional syslog. Systemd introduced its own logging system: it is implemented by a daemon, journald, which stores logs in binary format into a “journal”, which can be queried by the journalctl utility.

In this tutorial we will learn some parameters we can use to modify the journald daemon behavior, and some examples of how to query the journal and format the output resulting from said queries.

In this tutorial you will learn:

  • How to change default journald settings
  • How journald can coexist with syslog
  • How to query the journal and some ways to format the queries output

Read more

How to create incremental backups using rsync on Linux

How to create incremental backups using rsync on Linux

In previous articles, we already talked about how we can perform local and remote backups using rsync and how to setup the rsync daemon. In this tutorial we will learn a very useful technique we can use to perform incremental backups, and schedule them using the good old cron.

In this tutorial you will learn:

  • The difference between hard and symbolic links
  • What is an incremental backup
  • How the rsync –link-dest option works
  • How to create incremental backups using rsync
  • How to schedule backups using cron

Read more

HOW TO VERIFY ISO IMAGE INTEGRITY

How to verify the integrity of a Linux distribution iso image

When we decide to install an operating system based on the Linux kernel, the first thing we do is to download its installation image, or ISO, from the official distribution website. Before proceeding with the actual installation, however, it is crucial to verify the integrity of the image, to be sure it is what it claims to be, and nobody has compromised it. In this tutorial we will see the basic steps we can follow to accomplish this task.

In this tutorial you will learn:

  • What is the basic difference between gpg encrypting and signing
  • How to download and import a gpg public key from a key server
  • How to verify a gpg signature
  • How to verify the checksum of an ISO

Read more

How to create compressed encrypted archives with tar and gpg

How to create compressed encrypted archives with tar and gpg

There are many reasons why you may want to create compressed encrypted file archives. You may want to create an encrypted backup of your personal files. Another possible scenario is that you may want to privately share content with a friend or colleague over the web or through cloud storage. Tar.gz files, or compressed tarballs, are created using the tar command. These tarballs are pretty much the standard go-to format for archives on GNU/Linux, however they are not encrypted. In the above scenarios that we mentioned it is often desirable to have encryption in order to secure your data. This is where gpg comes in.

Read more

xargs for beginners with examples

xargs for beginners with examples

Using xargs, described in the Linux xargs manual as a tool which builds and execute command lines from standard input, once can exert a significant amount of additional power over any other command executed on the Bash command line. Basically, xargs will take the output from any other tool, and use that as it’s own input for further processing and action (hence the reference to executing command lines in the manual). If this is your first few weeks or months with xargs, or you are only just starting, this is the best place for you to get into xargs.

In this tutorial you will learn:

  • How to use xargs from the command line in Bash
  • How xargs works, what it does, and how to use it well
  • Basic usage examples using xargs from the command line in Bash

Read more

Random Entropy in Bash

Random Entropy in Bash

When using random numbers in Bash, the question of random entropy will sooner or later come up. This article will help you understand what entropy is, how it can be modified and optimized in Bash, and how it will affect random number generation.

In this tutorial you will learn:

  • How to generate random entropy in Bash
  • How to pre-seed the random number generator in Bash
  • Examples demonstrating random entropy generation in Bash

Read more

Bash regexps for beginners with examples

Bash regexps for beginners with examples

Using regular expressions in Bash provides you with plenty of power to parse nearly every conceivable text string (or even full documents), and transform them into nearly any output desirable. If you regularly use Bash, or if you regularly work with lists, textual strings, or documents in Linux, you will find that many jobs can be simplified by learning how to use regular expressions in Bash. Continue reading to learn basic Bash regular expression skills! If you are already familiar with basic regular expressions in Bash or another coding language, see our more advanced bash regular expressions. If not, continue reading to learn basic Bash regular expression skills!

In this tutorial you will learn:

  • How to use regular expressions on the command line in Bash
  • How regular expressions can parse and transform any text string and/or document
  • Basic usage examples of regular expressions in Bash

Read more