In some Bash scripts, there is an option to pass arguments to the script when you are executing it. This allows the user to specify more information in the same command used to run the script.
bash
Bash Script: Set variable example
If you are writing a Bash script and have some information that may change during the execution of the script, or that normally changes during subsequent executions, then this should be set as a variable.
Bash Scripting: Nested if statement
An if
statement in a Bash script is the most basic way to use a conditional statement.
Bash Script: Case statement examples
If you already have some experience with writing Bash scripts, then you have probably needed to use conditional statements in the past. You may already be familiar with using if statements in a Bash script. Case statements work similarly but are more scalable and can handle many possibilities with ease.
Bash Script: Hello World Example
When getting started with a new scripting or programming language, such as Bash scripting on Linux, the first thing a user learns to create is a Hello World script.
Bash Scripting: Execute command from within the script
Bash scripts are, essentially, just a series of Linux commands that have been chained together in order to accomplish something. Depending on your code, there are a few different ways to execute commands inside the script.
Bash Scripting: Arithmetic operations
The need to perform basic arithmetic operations is common in all types of programming, including in Bash scripts. A Linux system has multiple ways to perform arithmetic operations, and it is up to the user to decide the best method for the scenario at hand.
Check file access and modification time in Linux
The purpose of this tutorial is to show show several command line methods you can use to check file access and modification time on a Linux system.
Preserve file permissions and ownership with cp command
The cp command on a Linux system is one of the most basic commands that many users will utilize every day, whether they are new to Linux or a system administrator.
Linux Commands
Are you a beginner GNU/Linux user and wish to look beyond the usual window dragging and mouse clicking? This guide is intended for the absolute beginner users wishing to learn the basics of GNU/Linux command line. This tutorial intends to walk through basic Linux commands related to navigation, file and directory administration, software installation and basic system troubleshooting.
Bash for loop examples
With a Bash for
loop on a Linux system, it is possible to continue executing a set of instructions for a certain number of files or until a particular condition is met.
Bash Scripting: Check if file exists
When writing a Bash script, it is common that you’ll run into the need to check for the existence of a file. Based on the result, your Bash script can proceed with the appropriate action.