Running commands or processes in the background on a Linux system becomes a common task if you need to free up your terminal or disconnect from an SSH session. This is especially true of commands that run for a long time, either to listen for events or complete their lengthy task.

We have a few options on Linux for running commands in the background. In this guide, we'll cover a few different methods and show you how to use them through examples.

In this tutorial you will learn:
  • How to put a running command into the background
  • How to start a command in the background
  • How to close terminal and keep background job running
  • How to use the screen command
Putting a process into the background and moving it to the foreground
Putting a process into the background and moving it to the foreground

Logical Volume Manager (LVM) is used on Linux to manage hard drives and other storage devices. As the name implies, it can sort raw storage into logical volumes, making it easy to configure and use.

In this guide, you'll learn how LVM works on Linux systems. There's no better way to learn about LVM than simply running through an example, which is exactly what we'll do in the steps below. LVM works the same on any Linux distribution, so you can use any of the commands below on your own system.

Follow along with us as we use LVM to create partitions, physical volumes, a virtual group, logical volumes, and filesystems on a hard disk. We'll also show how to mount, extend, and remove our newly created logical volumes. By the end of this tutorial, you'll have a full understanding of how to use LVM and apply your own configurations.

In this tutorial you will learn:
  • How to install LVM on major Linux distros
  • How to create partitions
  • How to create physical volumes
  • How to create a virtual group
  • How to create logical volumes
  • How to create a filesystem on logical volumes
  • How to edit fstab to automatically mount partitions
  • How to mount logical volumes
  • How to extend a logical volume
  • How to remove a logical volume
Logical Volume Manager - Tutorial Scenario
Logical Volume Manager - Tutorial Scenario

When you type a command into a Linux terminal, what's really happening is that a program is being executed. Normally, to execute a custom program or script, we need to use its full path, such as /path/to/script.sh or just ./script.sh if we're already in its residing directory. Alternatively, we can execute a lot of commands without specifying paths, like uptime or date, etc.

The reason we don't need to specify paths for some commands is because of the $PATH variable. This is a variable that can be configured to tell our Linux system where to look for certain programs. That way, when typing date into the terminal, Linux checks the $PATH variable to see a list of directories to look for the program.

In this guide, we'll see how to add a directory to the $PATH variable on Linux. This will enable you to call on your program or script from anywhere in the system, without needing to specify the path to where you've stored it. Follow along with us as we show how to view the directories in $PATH, and add a directory either temporarily or permanently to the variable.

In this tutorial you will learn:
  • How to see currently configured directories in $PATH shell variable
  • How to temporarily add directory to $PATH
  • How to permanently add directory to $PATH
Adding a directory to $PATH on Linux
Adding a directory to $PATH on Linux

rsync stands for "remote sync" and is a powerful command line utility for synchronizing directories either on a local system or with remote machines. It's built into nearly every Linux system by default.

Some users mistakenly think of rsync as a file copying tool, like cp or scp. While there's some overlap, rsync excels in synchronization, specifically. In other words, it can take a source directory and make an identical destination directory. And when a file changes in the source directory, rsync can efficiently synchronize the contents to the destination directory, only transferring the bits that have changed. It's also a very secure utility, utilizing SSH for remote file transfers.

This makes rsync work very well as a backup tool, on top of file copying. Many backup utilities use rsync in some form or another, because some users don't bother to learn how to use the rsync command. In reality, it can be very complex, but rsync only gets complicated when you need to do specific things. If you learn about rsync from the basics, it's easy to wrap your head around.

In this guide, we'll learn how to use the rsync command through examples. Follow along on your own system if you have two directories that you'd like to keep in sync, and learn to master the rsync command.

In this tutorial you will learn:
  • rsync command line examples
rsync command on Linux
rsync command on Linux

The tcpdump command can be used to capture network traffic on a Linux system. It's a versatile command line utility that network administrators often rely on for troubleshooting.

What you'll come to find is that the amount of networking traffic captured on an interface can be easily overwhelming. tcmpdump makes our job a little easier by allowing us to isolate only the traffic we're interested in. Of course, in order to do this, you need to be familiar with the various flags and settings that go along with the command.

In this guide, you'll see how to use tcpdump through examples and explanations. Follow along on your own system if you want to learn to capture network traffic and master the tcpdump command.

In this tutorial you will learn:
  • How to install tcpdump on major Linux distros
  • tcpdump command examples
  • How to filter tcpdump traffic by port, protocol, source, and destination
  • How to write tcpdump captures to file
  • How to interpret tcpdump command output
Using tcpdump command to capture network traffic on Linux
Using tcpdump command to capture network traffic on Linux

The ps command is a default command line utility that can give us insight into the processes that are currently running on a Linux system. It can give us a lot of helpful information about these processes, including their PID (process ID), TTY, the user running a command or application, and more.

While this sounds pretty simple, make no mistake, the ps command can get quite complicated. It accepts a lot of different options, and can be useful in an incredible number of situations, even as part of a bash script.

In this tutorial, we'll introduce you to the ps command, and go over all of its most helpful options, including a lot of examples. By the end of reading this guide, you'll be armed with all the information you need in order to get the most out of this helpful command line tool.

In this tutorial you will learn:
  • How to list all the processes running on a system
  • How to use ps command through examples
Using the ps command to identify running processes on a Linux system
Using the ps command to identify running processes on a Linux system

SELinux, which stands for Security Enhanced Linux, is an extra layer of security control built for Linux systems. The original version of SELinux was developed by the NSA. Other key contributors include Red Hat, which has enabled it by default in their own RHEL and its derivative Linux distributions.

Although SELinux can protect our system through access control for programs and system services, it's not always necessary to have it enabled. Some users may even find that it interferes with certain programs they try to install. Certain distributions also have their own recommended alternative to SELinux. For example, Ubuntu uses AppArmor, which should be used instead of SELinux. In this guide, we'll go over the step by step instructions to disable SELinux on all major Linux distributions.

In this tutorial you will learn:
  • How to check the status of SELinux
  • How to put SELinux in permissive mode
  • How to disable SELinux
Disabling SELinux
Disabling SELinux

Zstandard, often abbreviated as zstd, is a relatively new compression tool that premiered in 2015. It was created by engineers at Facebook, looking to improve on the speed and compression ratio of longstanding tools like gzip. It's quickly becoming a standard compression tool on many Linux distros, so now's a perfect time to learn about using it.

In this guide, we'll go over the instructions to install and use zstd on Linux, with command line examples that show you how to compress files as well as open archives that use zstd.

In this tutorial you will learn:
  • How to install Zstandard on major Linux distros
  • How to use Zstandard through command line examples
Compressing a file with zstd on Linux
Compressing a file with zstd on Linux

When it comes to tidying up your hard drive on Linux, either to free up space or to become more organized, it's helpful to identify which files are consuming the most storage space.

In this guide, we'll show you how to identify the largest files on your Linux system, through both command line and GUI methods. You can also see our other guide on checking disk usage by folder if you'd like to identify hefty directories instead of individual files.

In this tutorial you will learn:
  • How to find large files via command line with find
  • How to find large files via GUI with QDirStat
Finding large files on Linux
Finding large files on Linux

Every Linux system 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.

Keeping your Linux kernel up to date is an important task for administrators and users alike. Do you know what kernel version your Linux distribution is running? In this guide, we'll show you how to find the Linux kernel version through various command line utilities.

In this tutorial you will learn:
  • How to check kernel version with uname, hostnamectl, and /proc/version
Multiple commands showing the kernel version of a Linux system
Multiple commands showing the kernel version of a Linux system

An ISO file is an image file of a CD/DVD or other disc. It contains all the files from the disc, neatly packed into a single .iso file. This allows users to burn new copies of the disc, or they can open the ISO file to browse and copy its contents to their system.

An ISO file can also be mounted, which is the virtual equivalent to inserting a disc into your PC. The operating system will treat the ISO as a physical CD rom. In this guide, we'll see how to open and mount an ISO file on a Linux system. This can be done from both command line and GUI, so we'll be covering the steps for both methods.

Since the instructions will vary depending on what desktop environment you're using, we'll be covering the steps for GNOME, KDE, and Xfce. The steps for command line should be the same across any Linux distribution.

In this tutorial you will learn:
  • How to open and mount an ISO file via GNOME GUI
  • How to open and mount an ISO file via KDE GUI
  • How to open and mount an ISO file via Xfce GUI
  • How to open and mount an ISO file via command line
Mounting and accessing an ISO file in Linux
Mounting and accessing an ISO file in Linux

Normal user accounts on Linux have their own home directory. This is the location where all of the user account's personal files typically reside, including their recent downloads, desktop contents, etc.

By default, a user's home directory is usually located at /home/username where "username" is the name of the user account. However, you can actually place a user's home directory just about anywhere you'd like. Linux gives us the option to choose a location for the home directory whenever we are creating a new user.

In this guide, we'll go over the commands needed to specify a custom home directory when creating a new user on Linux.

In this tutorial you will learn:
  • How to create a user with a custom home directory
Adding a new user with custom home directory on Linux
Adding a new user with custom home directory on Linux

Sysctl is a utility installed by default in all modern Linux distributions. It is used both to read and write the value of kernel parameters at runtime; the available parameters are those listed under the /proc pseudo-filesystem, and specifically under the /proc/sys directory. In this article we learn how to use this utility, how to make changes persist a reboot, and how to load settings from a file “manually”.

In this tutorial you will learn:

  • How to read the value of kernel parameters
  • How to modify the value of kernel parameters at runtime
  • How to make changes persist a reboot
  • How to load settings from a file manually

The diff utility is, in the vast majority of cases, installed by default in every Linux distribution out there. The program is used to calculate and display the differences between the contents of two files. It is mainly used when working with source code two compare the same versions of two files and highlight the differences between them. In this article we will learn the various modes in which diff can work and how to create a diff file which can later be applied as a patch with the patch utility.

In this tutorial you will learn:

  • How to use diff
  • How to display the output of diff on two columns when using diff in normal mode
  • How to read the diff output in normal, context and unified mode
  • How to create a diff file and apply it as a patch with the patch utility

Libvirt is a free and open source software which provides API to manage various aspects of virtual machines. On Linux it is commonly used in conjunction with KVM and Qemu. Among other things, libvirt is used to create and manage virtual networks. The default network created when libvirt is used is called “default” and uses NAT (Network Address Translation) and packet forwarding to connect the emulated systems with the “outside” world (both the host system and the internet). In this tutorial we will see how to create a different setup using Bridged networking.

In this tutorial you will learn:

  • How to create a virtual bridge
  • How to add a physical interface to a bridge
  • How to make the bridge configuration persistent
  • How to modify firmware rules to allow traffic to the virtual machine
  • How to create a new virtual network and use it in a virtual machine
How to use bridged networking with libvirt and KVM
How to use bridged networking with libvirt and KVM

FIND LATEST LINUX JOBS on LinuxCareers.com
Submit your RESUME, create a JOB ALERT or subscribe to RSS feed.
LINUX CAREER NEWSLETTER
Subscribe to NEWSLETTER and receive latest news, jobs, career advice and tutorials.
DO YOU NEED ADDITIONAL HELP?
Get extra help by visiting our LINUX FORUM or simply use comments below.

You may also be interested in: