Loops are primary requirement of any programming languages. Loops are useful when you want to execute a series of commands until the certain condition is satisfied. In Bash, loops are useful for automating repetitive tasks. In this tutorial, we will see basics of while loop in Bash. There are three basic loops for loop, while
terminal - Page 4 of 13 - DesignLinux
Bash break and continue
Using loops you can run multiple commands until the condition is satisfied. But sometimes you need to divert the flow of loop or terminate the loop iteration. In such cases, you can use break and continue statements in bash to handle the loop execution. In this guide we will how to use break and continue
Rmmod Command in Linux
The core component of each Linux operating system is the Linux kernel. It manages the system’s resources, and acts as an intermediary between the computer’s hardware and software. The Linux kernel is a software that has a modular design. A kernel module, or often referred to as a driver, is a piece of code that
Bash Sequence Expression (Range)
Using Bash sequence expression you can generates a range of integers or characters by providing the start and the end point of the range. In this guide, we will show you the basics of the sequence expression in Bash. Bash Sequence Expression# Below is the basic form of the sequence expression: {START..END[..INCREMENT]} The expression starts
Gunzip Command in Linux
Using Gunzip command-line tool you can decompressing Gzip files. Gzip is the popular compression algorithms to reduce the size of a file and keep the original file mode, ownership, and timestamp. In this tutorial, we will show you how to use the gunzip command. Decompressing Files with gunzip# Below is the basic syntax for the
How to Compare Strings in Bash
At the time of writing bash scripts, it’s often required to compare two strings to check it wether those are equal or not. Two strings are equal when they have the same length and contain the same sequence of characters. This guide shows you how to compare strings in Bash. Comparison Operators# Comparison operators are
Bash Case Statement
The bash case statement can be used when you have multiple choices conditions. Using bash case statement, it will be more readable and easier to maintain instead of nested if statements. This tutorial shows you the basics and use of the Bash case statement in shell scripts. The Bash case statement has a similar concept
Echo Command in Linux with Examples
In Linux, the echo command is most common and frequently used command. It will print the passed arguments to the standard output. Generally, echo command is used in shell scripts to show a message or output the results of other commands. echo Command# By default, the echo is built-in in Bash and other shells like
Touch Command in Linux
The touch command is used to create a new empty files and update the timestamps of existing files and directories. In this tutorial, we will cover how to use the touch command with examples. Linux Files Timestamps# At first, we will see the file timestamps in Linux. There are three timestamps of a Linux file:
How to Start, Stop, or Restart Nginx
Nginx is a free, high performance and open-source HTTP and reverse proxy server. It can be used as a standalone web server, and as a reverse proxy for Apache and other web servers. In this guide, we will show you how to start, stop and restart Nginx on Linux. For a system administrator or a