The Baeldung logo
  • The Baeldung LogoLinux Sublogo
  • Start Here
  • Write for Baeldung
  • About ▼▲
    • Full Archive

      The high level overview of all the articles on the site.

    • About Baeldung

      About Baeldung.

Scripting

Scripting allows us to programmatically interact with the Linux operating system. Learn about some basic scripting fundamentals as well as some advanced topics focused on Bash.

  • bash (35)
  • awk (30)
  • echo (25)
  • sed (19)
  • grep (13)
  • read (11)
  • printf (11)
  • cat (11)
  • Shell (9)
  • alias (8)
  • find (7)
  • xargs (7)
  • source (7)
  • perl (6)
  • tr (6)
  • tail (5)
  • ssh (5)
  • copy-edit (5)
  • ls (5)
  • export (5)
  • vi (4)
  • wait (4)
  • set (4)
  • cron (4)
  • watch (4)
  • sudo (4)
  • expr (4)
  • let (4)
  • env (4)
  • expect (4)
  • make (3)
  • vim (3)
  • eval (3)
  • chmod (3)
  • rsync (3)
  • pgrep (3)
  • readlink (3)
  • reference (3)
  • time (3)
  • date (3)
  • cd (3)
  • pushd (3)
  • wget (3)
  • tee (3)
  • curl (3)
  • cut (3)
  • paste (3)
  • sort (3)

>> What’s the Difference Between bash script.sh and ./script.sh

>> How to Compile Code from Vim

>> Convert Text to PDF From the Command Line

>> The wait Command in Linux

>> How to Read Log Files Between Two Dates

>> How to Store Standard Error in a Linux Variable

>> IP Address Geolocation Lookups on Linux With GeoLite2

>> Iterate Over a Range of Numbers Defined by Variables in Bash

>> Iterating in Reverse Using for Loops and Other Constructs

>> Cleartext Passwords in the Shell and How to Handle Special Characters

>> Printing awk Output in the Same Line

>> “Illegal option -o pipefail” While Using the set Command

>> Using nohup With a for Loop

>> Encrypted Remote Backups via rsync

>> Print Decimal as ASCII Using the Shell

>> How to Filter strace’s Output Using grep

>> How to Check the Existence of Input Argument in a Bash Script

>> Parsing, Validating, and Printing JSON in Shell Scripts

>> Shell Auto Completion in Linux

>> How to Iterate Over a List of Strings in a Shell Script

>> Line Endings and Resolving the configure: /bin/sh: bad interpreter Error

>> Filter Processes by Process Names With top

>> Replacing Specific Line With a String Variable in Shell

>> Executing Multiple Commands in Find -exec

>> Augmenting the Default Search Path for Python

>> How to Process a Bash Variable With sed

>> Path of Bash Script From Symbolic Link

>> Different Types of Shebang in Linux

>> In What Order Do Piped Commands Run?

>> Idling and Dummy Executable Files that Do Nothing in Linux

>> Convert INI File Into a Bash Array

>> Generating Keys Without a Passphrase with OpenSSH, PuTTY, and OpenSSL

>> Decoding Encoded URLs in Linux

>> How to Use which on an Aliased Command

>> How to Run a Cron Job Periodically Between a Time Range

>> How to Use the Batch Mode of rsync

>> Using Colors With the watch Command

>> How to Retry a Failed Command in Shell

>> What Is the SSH known_hosts File and How to Temporarily Ignore It

>> Implementing a Command Line Progress Bar

>> Docker Compose: Wait for Container X Before Starting Y

>> PC Speaker Beep in Linux

>> Edit /etc/sudoers From a Script

>> How to Make Output Overwrite the Same Line in a Terminal

>> Check Whether a MySQL Database Exists Using Shell

>> Printing ASCII Art in the Shell

>> Run Cron Job Manually With Proper Environment

>> Execute Shell Commands and Silence Them in Vim

>> Indenting and Turning Off Auto Indent When Pasting Text Into Vi

>> Script to Automatically Test if a Website Is Available

>> How to Create a Random Human-Readable Text File in Linux

>> Compare Variables With Numbers in Bash

>> One Line if-else Condition in Linux Shell Scripting

>> Execute a Linux Command Without Keeping It in History

>> Run Multiple Commands in Docker CMD Directive

>> Creating UUIDs in Bash

>> Determine Whether a Shell Variable Is Empty

>> Interactive, Non-interactive, Login, Non-login Shells in Linux

>> Run a Shell Script Without Using “sh” or “bash” Commands

>> Recall the Previous Command or Its Arguments in Bash

>> Converting Strings to Numbers in the Linux Command Line Interface

>> Differences Between Single and Double Brackets in Bash

>> Setting Environment Variables for systemd Services

>> When to Avoid Using && in Shell Scripts

>> Bash Bitwise Operators

>> Waiting for a File in a Shell Script

>> Execute a Command Whenever File or Directory Changes

>> Why Looping Over find’s Output Is a Bad Practice

>> Check if Command Executed Successfully in Linux

>> How to Run Multiple Bash Scripts in a Terminal Window

>> Running a Script That’s Not Executable

>> Creating a Simple Select Menu in the Shell Script

>> Running a Command That Is Shadowed by an Alias

>> Checking Whether a Directory Exists in a Shell Script

>> Concatenate String Variables in Bash

>> Differences Between the return and exit Commands

>> Difference Between Sourcing and Executing a Shell Script

>> The set Command in Linux

>> Why Is Using a Shell Loop to Process Text a Bad Practice?

>> Script That Counts Files Then Removes the Oldest Ones

>> Retrieve Video Information on the Command Line in Linux

>> Compare Strings in Dot-Separated Version Format

>> List All Available Commands and Aliases in Linux

>> Split a List by Comma in Bash

>> Linux Shells Performance: dash vs bash

>> Safe Use of eval in Bash

>> Redirecting the Output of the time Command

>> Raise an Error in Bash Script

>> Handling Special Characters in Shell Scripts

>> rsync and Hidden Files

>> Hiding User Input in a Bash Terminal

>> Guide to Getting DST-Safe Relative Dates

>> The Difference Between #!/usr/bin/bash and #!/usr/bin/env bash

>> Reading/Parsing Properties File in a Linux Script

>> When to Wrap Quotes Around Arguments in a Shell Command

>> Suppress Echo of Command Invocation in a Makefile

>> How to Safely Exit from Bash Scripts

>> Print Statistics of Numbers on the Linux Terminal

>> Automating Telnet Sessions Using expect

>> Bash: let Statement vs. Assignment

>> The Conditional Variable Assignment Operator in a Makefile

>> Inserting a Newline in a Variable in Bash

>> Fixing the “/bin/sh: pushd: Not Found” Error in Linux

>> Iterating Over Each Line of ls -l Output

>> Substitute Shell Variables in a Text File

>> Division with Variables in a Linux Shell

>> Automatically Capture Output of the Last Command Into a Variable Using Bash

>> What is a Sysroot?

>> Downloading Content Using wget Without Following Redirects

>> Using the passwd Command from Within a Shell Script

>> Checking if a Variable Is a Number in Bash

>> The /bin/true and /bin/false Commands in Linux

>> Kill a Child Process After a Given Timeout in Bash

>> Looking for a Linux Technical Editor for Baeldung (not open)

>> Run a Script With a Different Working Directory

>> How to Write Stdout to a File with Colors

>> Flow Control in Bash Without Goto

>> Round a Divided Number in Bash

>> Use the Lines of a File as Arguments of a Linux Command

>> Set Environment Variables for a Bash Command

>> Find the Script’s Filename Within the Same Script in Bash

>> Configure a Systemd Service to Restart Periodically

>> How to Write Bash Variable Contents to a File

>> Using grep on a Continuous Stream

>> Read Values Into a Shell Variable From a Pipe

>> Linux Command-Line Tools to Take Website Screenshots

>> Replacing Whitespaces With Tabs in a File in Linux

>> Return Value of Substitutions With sed and awk

>> Merging Images in the Linux Terminal

>> Use of Dash “-” in Command-Line Parameters

>> xargs With Multiple Arguments

>> Include Files in a Bash Shell Script With source Command

>> Restrict Commands for SSH Users

>> Solving The “Cannot Open Shared Object File: No Such File Or Directory” Error In Linux

>> Start Script After Another Finishes In Linux

>> Run Bash Script as a Daemon

>> POSIX Shell Array/List Data Structure

>> Convert Hex to ASCII Characters in the Linux Shell

>> Expand A Relative Path In Bash

>> How to Run Bash Commands From a Text File

>> Get Bash Script Location From Within the Script

>> How to Remove Non UTF-8 Characters From a File

>> Pipe Output to Bash Function

>> Parse Command Line Arguments in Bash

>> Running a Shell Script on a Remote Machine Through SSH

>> Escaping Characters in Bash

>> Debugging Programs Using the GDB Command

>> Testing Bash Scripts With Bats

>> Segmentation Fault in Linux

>> Get Unique Values from an Array in Bash

>> Checking if a Linux Environment Variable Is Set or Not

>> Looping Through the Content of a File in Bash

>> Show Line Number When Executing a Bash Script

>> Using the Exclamation Mark (!) in Bash

>> Using 2D Arrays in Bash Under Linux

>> Removing the Last Character of a File

>> Check if a Variable Exists in a List in Bash

>> Escape a Single Quote in Single Quote String in Bash

>> How to Create an Alias in Linux

>> List Environment Variables in Linux

>> Simulating the Enter Keypress in Bash Scripts

>> Bash – Using History Efficiently

>> Filtering Only the Standard Error in Linux

>> Using printf and echo in Linux

>> How to Create a CPU Spike in Bash

>> Get the Path of a Linux Command

>> Restart a NoSQL Database Like MongoDB

>> Check the Syntax of a Bash Script Without Running It

>> Identify User in a Bash Script Called by sudo

>> Delete an Exported Environment Variable in Shell

>> Create Bash Alias That Accepts Parameters

>> Extracting a Substring in Bash

>> Clear a Terminal Screen in Linux

>> How to Add Up a Column of Numbers in Bash

>> Solving the “Unary Operator Expected” Error

>> Standard Exit Status Codes in Linux

>> Concatenate Two Strings to Build a Complete Path in Linux

>> Get Exit Code of a Background Process

>> Kill a Process Running on a Specific Port in Linux

>> Aborting a Shell Script if Any Command Fails

>> Display Specific Columns From a File in Linux

>> Difference between ${} and $() in Bash

>> Preserve Linebreaks When Storing Command Output to a Variable

>> Bash Script to Calculate Time Elapsed

>> Iterate Over a List of Files With Spaces in Their Names in Linux

>> File Editing: Appending a Non-Existent Line to a File

>> How to Insert a New Line Character in Linux Shell Script Output

>> Linux Bash: Multiple Variable Assignment

>> Showing a GUI Notification From a Shell Script in Linux

>> Storing a Command in a Variable in a Shell Script

>> Run a Script on Startup in Linux

>> Negate an if Condition in a Bash Script

>> When to Use an Alias vs Script vs a New Function in Bash

>> Using sed With a Literal String Instead of an Input File

>> Difference Between .bashrc, .bash-profile, and .profile

>> How to Create a crontab Through a Script

>> Pass the Output of a Command as an Argument for Another

>> Ensure Only One Instance of a Bash Script Is Running

>> The Meaning of IFS in Bash Scripting

>> Check if a String Contains a Substring in Linux

>> Running Script or Command as Another User in Linux

>> Running Multi-Line Shell Code at Once From Single Prompt

>> Guide to Generate Random Numbers in Linux

>> Debugging a Bash Script

>> Get the Contents of a Web Page in a Shell Variable

>> How to Parse a CSV File in Bash

>> What is a .pid File?

>> How To Write a Bash Script That Answers Interactive Prompts

>> How To Script “Yes” When Installing Programs

>> The Uses of the Exec Command in Shell Script

>> Splitting a File at Given Line Numbers

>> How to Delete Multiple Files at Once in Bash

>> Difference Between grep, sed, and awk

>> Run a Function in a Script from the Command Line

>> Here Document And Here String

>> Running Multiple Commands in the Background

>> How to Use the Paste Command

>> Implement a Counter in Bash Script

>> Writing Text to File Using Linux Cat Command

>> Conditional Expressions in Shell Script

>> Save Modifications In-Place with awk

>> Repeat a Linux Command at a Given Interval

>> Appending Lines to a File

>> Defining a Bash Variable With or Without ‘export’

>> What Does a Double-Dash in Shell Commands Mean?

>> Command Substitution

>> Commands to Get the Min, Max, Median, and Mean of a Dataset

>> Execute Bash Script Directly From a URL

>> Send stdout to Multiple Commands

>> When to Use xargs

>> How to Evaluate Arithmetic Expressions in Bash

>> Linux comm Command

>> The Linux join Command

>> Using sed to Replace a Multi-Line String

>> Reading Output of a Command Into an Array in Bash

>> Bash Special Variables

>> Directory Navigation Using the pushd and popd Commands

>> How to Call an External Program Using awk

>> Read Random Line From a File in Linux

>> Linux source Command

>> Introduction to Bash Array

>> How to Reverse the Order of Lines in a File in Linux

>> String Manipulation in Bash

>> Linux ping Command

>> Introduction to the tee Command

>> Remove the First Characters of a Line

>> Linux man Command

>> How to Use the cd Command in Bash Scripts

>> How to Join Multiple Lines Into One

>> Linux Scripting Series

>> How to Change Terminal Output Color in Linux?

>> Is There a Way to ‘uniq’ by Column?

>> Using Shebang #! in Linux Scripts

>> Guide to the sed Stream Editor

>> “Cut” Command in Linux

>> date Command in Linux

>> Linux watch Command

>> The echo Command in Linux

>> Execute a Command in Multiple Directories on Linux

>> Working with the AWS CLI for EC2

>> Guide to the AWK Programming Language

>> Cron Job Testing and Debugging in Linux

>> Bash Functions in Linux

>> Guide to the Linux read Command

>> How to Use Command Line Arguments in a Bash Script

>> How to Pass Command Line Arguments to Bash Script

>> Pipes and Redirection in Linux

>> Guide to Stream Redirections in Linux

>> Creating Symbolic and Hard Links with Linux Commands

>> Linux Commands – Looping Through Directories

>> Linux Commands – Repeat a Command n Times

>> Silencing the Output of a Bash Command

  • ↑ Back to Top
The Baeldung logo

Categories

  • Administration
  • Files
  • Filesystems
  • Installation
  • Networking
  • Processes
  • Scripting
  • Search
  • Security
  • Web

Series

  • Linux Administration
  • Linux Files
  • Linux Processes

About

  • About Baeldung
  • The Full Archive
  • Write for Baeldung
  • Editors
  • Terms of Service
  • Privacy Policy
  • Company Info
  • Contact
The Baeldung Logo