Shell / Bash Roadmap

This Shell / Bash Roadmap is a free, full-text syllabus of 166 lessons in 30 stages, starting with Introduction and ending with Package Management. It suits anyone who wants to learn Shell / Bash, whether new to it or filling gaps. There is no fixed length: every lesson is open from the start, so you go at your own pace and skip what you already know.

Last updated

Getting Started0%
Halfway
Almost There
Complete

Reading is open to everyone. Sign in to join this roadmap and track what you finish.

Continue learning

1. IntroductionIntroduction

0%

Introduction

4 topics · 3 sub-topics · 0 completed

0%

Full syllabus: every lesson in the Shell / Bash roadmap

30 stages and 166 lessons, in the order the roadmap suggests. Every lesson is free to read and open from the start.

  1. Stage 1: Introduction

    • Introduction

      Shell, often referred to as Bash (Bourne Again Shell), is a command-line interpreter. It acts as an interface between the user and the operating system, allowing users to execute commands, run scripts, and manage files. It interprets the commands entered by the user and instructs the operating system to perform the…

    • What is Bash?

      Bash, short for Bourne Again Shell, is a command-line interpreter and a shell scripting language. It's essentially a program that allows users to interact with the operating system by typing commands. Bash interprets these commands and instructs the operating system to perform specific actions, such as running…

    • CLI vs GUI

      A Command Line Interface (CLI) is a text-based interface used to interact with a computer system by typing commands. A Graphical User Interface (GUI), on the other hand, utilizes visual elements such as windows, icons, and menus to enable users to interact with the system using a mouse, touchpad, or touchscreen.

    • What is scripting?

      Scripting is the process of writing a series of commands that are executed in a specific order by a program or scripting engine. These commands, often written in a simple, human-readable language, automate tasks, control software applications, or interact with operating systems. Instead of manually entering…

  2. Stage 2: Popular Shells

    • Popular Shells

      A shell is a command-line interpreter that provides a user interface for interacting with an operating system. Different shells offer varying features, syntax, and capabilities, leading to the existence of several popular choices. These shells determine how you interact with the system, execute commands, and…

    • dash

      dash (Debian Almquist Shell) is a Unix shell that is smaller, faster, and requires fewer resources compared to Bash. It's often used as the default /bin/sh on Debian-based systems and is designed to be POSIX-compliant, focusing on speed and efficiency in script execution. This makes it suitable for boot scripts and…

    • bash

      Bash, short for Bourne Again Shell, is a command-line interpreter and a shell scripting language. It's a program that allows users to interact with the operating system by typing commands. Bash interprets these commands and instructs the operating system to perform specific actions, making it a fundamental tool for…

    • zsh

      Zsh, also known as the Z shell, is a Unix shell that can be used as an interactive login shell and as a shell script command interpreter. It's designed to be highly customizable and offers features like improved tab completion, shared command history across multiple terminal windows, and powerful theming options.…

    • fish

      fish is a user-friendly command-line shell for UNIX-like operating systems. It focuses on providing a more interactive and discoverable experience compared to traditional shells like Bash or Zsh. Key features include autosuggestions, syntax highlighting, and a simplified scripting language.

    • tcsh

      tcsh is an enhanced version of the C shell (csh), a Unix shell program. It's designed as an interactive login shell and a shell script command processor. tcsh provides features like command-line editing, filename completion, and a history mechanism, making it more user-friendly than its predecessor.

    • ksh

      ksh, or the Korn shell, is an interactive command language and scripting language. It's designed to be backward-compatible with the Bourne shell (sh) while incorporating many features from other shells like csh. ksh offers improvements in scripting capabilities, command-line editing, and job control, making it a…

    • cmd

      cmd, also known as the Command Prompt, is the default command-line interpreter on Windows operating systems. It allows users to interact with the operating system by entering text-based commands. These commands can be used to navigate the file system, execute programs, and perform various system administration tasks.

    • PowerShell

      PowerShell is a cross-platform task automation and configuration management framework, consisting of a command-line shell and associated scripting language. It's built on the .NET Common Language Runtime (CLR) and accepts and returns .NET objects, which allows for more complex and structured data manipulation…

  3. Stage 3: Setting Up Bash

    • Setting Up Bash

      Setting up Bash involves configuring your shell environment to suit your preferences and workflow. This includes customizing the appearance of your command prompt, defining aliases for frequently used commands, setting environment variables to control program behavior, and creating custom functions to automate…

  4. Stage 5: Files & Directories

    • Files & Directories

      Files and directories are fundamental building blocks of a file system. Files store data, such as text, images, or executable code. Directories, also known as folders, organize files and other directories in a hierarchical structure, allowing users to navigate and manage their data effectively.

  5. Stage 4: Tab Completion

    • Tab Completion

      Tab completion is a feature in command-line interfaces that automatically completes commands, filenames, or other input based on what you've already typed. By pressing the Tab key, the shell attempts to fill in the rest of the word you're typing, saving you time and reducing errors. If multiple possibilities exist,…

  6. Stage 6: Repeat Commands

    • Repeat Commands

      In the shell, you can easily access and reuse previously executed commands. The most common way to do this is using the up and down arrow keys to navigate through your command history. Alternatively, you can use the history command to view a numbered list of past commands, and then execute a specific command by…

  7. Stage 7: Help Commands

    • Help Commands

      Help commands in a shell environment provide users with information about available commands, their syntax, and options. They are essential tools for understanding how to use commands effectively and discovering new functionalities within the shell. These commands allow users to quickly access documentation and…

  8. Stage 8: Bash Alias

    • Bash Alias

      A Bash alias is a shortcut or a custom name you assign to a command or a sequence of commands. Instead of typing a long command every time, you can create an alias that represents it. When you type the alias in the terminal, Bash replaces it with the original command before executing it. This simplifies…

    • stdin, stdout, stderr

      In computing, standard streams are preconnected input and output communication channels between a computer program and its environment. Specifically, stdin (standard input) is the channel through which a program receives input, typically from the keyboard or another program. stdout (standard output) is the channel…

    • Output redirection

      Output redirection in shell scripting allows you to control where the output of a command is sent. Instead of displaying on the terminal, you can redirect it to a file, either overwriting the file or appending to it. This is achieved using special operators like , , 2, and &. These operators provide a way to manage…

    • Input redirection

      Input redirection enables a command to obtain its input from a source other than the standard input (typically the keyboard). Instead of typing input directly, a command can read data from a file or another command's output. This is achieved using operators like < to specify the input source.

    • Error redirection

      Error redirection in shell scripting involves capturing and managing error messages generated by commands. By default, standard error (stderr) is displayed on the terminal. Error redirection allows you to redirect these error messages to a file, discard them, or pipe them to another command for further processing,…

    • Pipes

      Pipes in shell scripting are a form of redirection that allows you to send the output of one command as the input to another command. This creates a chain of commands where the data flows from one process to the next, enabling you to perform complex data manipulation and filtering concisely and efficiently. The…

    • Command substitution

      Command substitution allows you to use the output of a command as an argument to another command. It essentially captures the standard output of a command and inserts it into the command line of another command, enabling you to dynamically generate arguments or values based on the results of other commands. This is…

    • Process substitution

      Process substitution allows you to treat the output of a process as if it were a file. It provides a way to pass the output of one command as input to another command, without using temporary files or named pipes. This is achieved by creating a temporary file-like object (either a named pipe or a file in /dev/fd)…

  9. Stage 9: Stop Execution

    • Stop Execution

      Stopping execution in a shell script refers to halting the script's progress, often due to an error, a specific condition being met, or a user's request. This can be achieved through various commands and techniques that control the flow of the script, ensuring that it doesn't continue running when it shouldn't.…

    • pwd

      pwd (print working directory) is a command-line utility that displays the absolute path of the current directory you are working in. It essentially tells you where you are located within the file system hierarchy from the root directory. This is useful for navigating and understanding your position within the…

    • ls

      ls is a command-line utility used to list files and directories within a specified directory. By default, it displays the contents of the current working directory. It offers various options to control the output, such as displaying file sizes, modification dates, permissions, and hidden files.

    • cd

      cd is a fundamental command used to change the current working directory in a shell environment. It allows you to navigate through the file system, moving from one directory to another. By specifying a target directory as an argument, cd updates the shell's internal record of the current location, affecting…

    • echo

      echo is a fundamental command-line utility used to display lines of text. It essentially prints its arguments to standard output, which is typically your terminal screen. This makes it useful for displaying messages, variable values, or the output of other commands within shell scripts.

    • mkdir

      mkdir is a command-line utility used to create new directories (folders) in a file system. It allows users to organize files by grouping them into logical structures. The command takes the name(s) of the directory(s) to be created as arguments, and it can also be used to create multiple directories at once or…

    • touch

      The touch command is a fundamental utility used to update the access and modification times of files and directories. If a file doesn't exist, touch creates an empty file with the specified name. It's commonly used to create new, empty files or to quickly update the timestamps of existing files without modifying…

    • rm

      The rm command in Unix-like operating systems is used to remove files or directories. It permanently deletes the specified files, so caution is advised when using it. By default, rm does not remove directories; specific options are needed to remove directories and their contents recursively.

    • rmdir

      rmdir is a command-line utility used to remove empty directories. It's a straightforward tool that helps in cleaning up directory structures by deleting directories that no longer contain any files or subdirectories. The command will return an error if the directory is not empty.

    • mv

      The mv command in Unix-like operating systems is used to move or rename files and directories. It allows you to relocate files from one directory to another, effectively changing their location within the file system. Additionally, mv can be used to change the name of a file or directory without altering its location.

    • cp

      The cp command in Unix-like operating systems is used to copy files and directories from one location to another. It creates an exact duplicate of the source file or directory at the specified destination, leaving the original intact. The command can be used to copy single files, multiple files, or entire directory…

    • cat

      cat is a command-line utility that is primarily used to display the contents of one or more files on the standard output (usually your terminal screen). It can also be used to concatenate files, meaning to combine them into a single output stream. The name "cat" is short for "concatenate."

    • find

      The find command is a powerful utility used to locate files and directories within a file system hierarchy. It allows you to search based on various criteria, such as name, size, modification time, permissions, and file type. The find command recursively traverses directories, making it suitable for locating files…

    • Navigate between dirs

      Navigating between directories in a shell environment involves moving from one location in the file system to another. This is primarily achieved using the cd (change directory) command, which allows users to specify the destination directory, whether it's a relative path from the current location or an absolute…

  10. Stage 10: Redirects & Pipelines

    • Redirects & Pipelines

      Redirects and pipelines are fundamental features in the shell that allow you to control the flow of data between commands. Redirects change where a command's input comes from or where its output goes, allowing you to read from files or write to files. Pipelines connect the output of one command directly to the…

  11. Stage 11: Text Editors

    • Text Editors

      Text editors are software programs that allow users to create, open, view, and modify plain text files. They are fundamental tools for writing code, scripts, configuration files, and general text-based documents. Unlike word processors, text editors focus on the raw text content without applying rich formatting or…

    • grep

      grep is a command-line utility used for searching plain-text data sets for lines matching a regular expression. It outputs the lines that contain the specified pattern, making it a powerful tool for filtering and locating specific information within files or streams of data. Its name comes from the ed command…

    • less, more

      less and more are command-line utilities used to view the contents of text files, one screen at a time. They allow users to navigate through the file, search for specific patterns, and perform other basic text manipulation tasks directly from the terminal. less is generally preferred over more because it offers…

    • head, tail

      head and tail are command-line utilities used to display the beginning or end of a file, respectively. head shows the first few lines of a file, while tail shows the last few lines. They are useful for quickly inspecting log files, configuration files, or any text-based data without opening the entire file in a…

    • find

      find is a command-line utility for searching files and directories within a specified directory hierarchy. It allows you to locate files based on various criteria, such as name, type, size, modification time, permissions, and more. The find command recursively traverses the directory structure, applying the…

    • cut, paste

      cut and paste are command-line utilities used for manipulating text files. cut extracts specific sections (columns) from each line of a file based on delimiters or character positions. paste merges lines from multiple files into a single output stream, typically by concatenating corresponding lines side-by-side.

    • join, split

      join and split are command-line utilities used for manipulating text files. join combines lines from two files based on a common field, creating a new file with the merged data. split, conversely, divides a single file into multiple smaller files, either by line count, file size, or a custom pattern.

    • tr

      The tr command in Unix-like operating systems is a command-line utility that translates or deletes characters. It reads standard input, performs the specified transformations, and writes the result to standard output. tr is often used for tasks like converting uppercase to lowercase, deleting specific characters,…

    • sed

      sed (Stream EDitor) is a powerful command-line utility used for text transformation. It operates on a stream of text, performing operations like searching, replacing, deleting, and inserting text based on patterns or line numbers. sed is commonly used in shell scripting for automating text editing tasks and…

    • awk

      awk is a powerful text processing tool in Unix-like operating systems. It scans input files line by line, searching for lines that match a specified pattern. When a matching line is found, awk performs a specified action on that line, such as printing it, modifying it, or extracting specific fields. It's…

    • wc

      wc is a command-line utility that displays the number of lines, words, and bytes (or characters) in a file. It's a simple yet powerful tool for quickly getting a summary of the size and content of text files. You can use it to count the number of lines in a log file, the number of words in a document, or the size…

    • sort

      sort is a command-line utility that arranges lines of text in a specific order. It can sort alphabetically, numerically, by month, or even based on custom criteria. By default, sort treats each line as a string and sorts them in ascending ASCII order, but its behavior can be modified using various options to handle…

    • uniq

      uniq is a command-line utility that filters adjacent matching lines from an input file (or standard input) and writes a single copy of the matching line to the output. It's primarily used to remove duplicate lines, but it requires that the duplicates be next to each other to be effective. Options allow you to count…

    • nl

      nl is a command-line utility that numbers the lines of a file or standard input. It reads lines, adds line numbers, and writes the result to standard output. You can customize the numbering style, starting number, and increment between numbers. It's useful for adding line numbers to code, documents, or any text…

    • *

    • ?

    • [...]

    • {...}

  12. Stage 12: Basic Editor Ops.

    • Basic Editor Ops.

      Basic editor operations involve fundamental actions performed within a text editor to create, modify, and manage files. These operations include opening, saving, and closing files, as well as inserting, deleting, copying, and pasting text. Navigating through a file, searching for specific content, and replacing…

  13. Stage 13: Bash Script Anatomy

    • Bash Script Anatomy

      A Bash script is essentially a plain text file containing a series of commands that the Bash interpreter executes sequentially. It typically starts with a shebang line specifying the interpreter to use, followed by comments explaining the script's purpose, and then the actual commands that perform the desired…

  14. Stage 14: Running Shell Scripts

    • Running Shell Scripts

      Running a shell script involves executing a file containing a series of commands that the shell interprets and performs. This allows you to automate tasks, create reusable tools, and manage system operations by grouping commands into a single executable unit. The script is typically a plain text file with a .sh…

    • Direct Execution

      Direct execution involves running a shell script by specifying its path directly to the shell. This method requires the script to have execute permissions set. When you directly execute a script, the operating system uses the shebang line (e.g., !/bin/bash) at the beginning of the script to determine which…

    • Running with Bash

      Running a shell script with Bash involves explicitly invoking the Bash interpreter to execute the commands within the script. This is typically done by using the bash command followed by the script's filename as an argument. This method ensures that the script is interpreted and executed using the Bash shell,…

    • Running with Source

      Sourcing a shell script executes the commands within the script in the current shell environment, rather than in a subshell. This means that any variables, functions, or aliases defined or modified within the script will directly affect the shell you're currently working in. This is in contrast to simply executing…

  15. Stage 15: Bash Data Types

    • Bash Data Types

      Bash, unlike some other programming languages, doesn't have explicit data types like integers, floats, or strings that you need to declare. Instead, everything is treated as a string. However, Bash can perform arithmetic operations on strings that contain numbers, effectively treating them as numerical values when…

    • Strings

      In Bash, strings are sequences of characters. They can be enclosed in single quotes ('...') or double quotes ("..."). Single quotes treat everything literally, meaning no variable substitution or command execution happens within them. Double quotes, on the other hand, allow for variable expansion and command…

    • Numeric

      Bash, by default, treats all variables as strings. However, Bash can perform arithmetic operations on variables that contain numeric values. While Bash doesn't have explicit data types like integers or floats in the same way as other programming languages, it interprets strings as numbers when used in arithmetic…

    • Arrays

      Arrays are ordered collections of elements, where each element can be accessed using an index. They allow you to store multiple values under a single variable name, making it easier to manage and manipulate related data. In Bash, arrays can hold strings or numbers, and they are indexed starting from zero.

    • Associative Arrays

      Associative arrays, also known as dictionaries or hash maps in other programming languages, are data structures that store key-value pairs. Unlike regular arrays which use numerical indexes to access elements, associative arrays use strings (or other data types in some languages) as keys. This allows you to…

    • Nano

      Nano is a simple, beginner-friendly text editor for Unix-like operating systems. It's designed to be easy to use, with a straightforward interface that displays command shortcuts at the bottom of the screen. Nano is often pre-installed on many systems, making it readily available for quick text editing tasks.

    • Vim

      Vim is a highly configurable text editor built to enable efficient text editing. It's an improved version of the vi editor distributed with most UNIX systems. Vim is known for its modal editing, allowing users to switch between different modes for inserting, deleting, and navigating text, making it a powerful tool…

    • Emacs

      Emacs is a highly customizable and extensible text editor, known for its powerful features and extensive ecosystem of extensions. It's more than just a text editor; it's often described as an operating system within an operating system due to its ability to handle tasks like file management, email, and even web…

    • Vi

      Vi is a powerful text editor that's been a standard part of Unix-like systems for decades. It operates in different modes, primarily command mode for issuing instructions and insert mode for typing text. Vi is known for its efficiency and keyboard-centric approach, allowing users to perform complex editing tasks…

    • Environment vs Shell vars.

      Environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer. They are part of the environment in which a process runs. Shell variables, on the other hand, are variables that are specific to the current shell session and are not automatically inherited…

    • Create, Print, Modify

      Variables in shell scripting are named storage locations that hold data. You can create a variable by assigning a value to a name. Printing a variable displays its stored value, and modifying a variable involves changing the value it holds, allowing you to update data within your scripts dynamically.

    • Variable Scopes

      Variable scope determines the region of a program where a declared variable can be accessed. It defines the visibility and lifetime of a variable. Understanding variable scope is crucial for writing clean, maintainable, and bug-free shell scripts, as it helps prevent naming conflicts and ensures that variables are…

    • Special variables

      Special variables in shell scripting are predefined variables that automatically hold specific values related to the shell's operation or the script's execution environment. These variables provide access to information like the script's name, the number of arguments passed to it, the exit status of the last…

    • Variables best practices

      Using variables effectively in shell scripts involves following certain guidelines to improve readability, maintainability, and prevent errors. This includes choosing descriptive names, initializing variables before use, using appropriate scoping, and quoting variables to avoid unexpected behavior due to word…

  16. Stage 18: Input/Output

    • Input/Output

      Input/Output (I/O) refers to the communication between a computer program and the outside world. This involves receiving data (input) from sources like the keyboard, files, or other programs, and sending data (output) to destinations such as the terminal, files, or other programs. In essence, it's how a program…

    • Read user input

      Reading user input in a shell script allows the script to interact with the person running it. This is achieved by pausing the script's execution and waiting for the user to type something and press Enter. The entered text can then be stored in a variable and used later in the script for various purposes, such as…

    • printf formatting

      printf is a command-line utility used to format and print text in a specific way. It allows you to control the appearance of output by using format specifiers, which define how different types of data (strings, numbers, etc.) should be displayed. This includes specifying the width, precision, alignment, and other…

    • Here documents

      Here documents (or "heredocs") are a way to redirect multiple lines of input to a command. Instead of typing input directly into the terminal or reading from a file, you can embed the input directly within your script. This is particularly useful for passing multi-line strings or configuration data to commands.

    • Here strings

      Here strings provide a way to pass strings to commands as standard input. They are a simplified form of here documents, designed for single-line input. Instead of redirecting a file or typing input directly, you can embed the string directly within the command using the <<< operator. This is particularly useful for…

  17. Stage 16: Comments

    • Comments

      Comments are explanatory notes added to code to make it easier to understand. They are ignored by the interpreter or compiler, meaning they don't affect how the program runs. They are primarily for human readers to understand the purpose and logic behind the code.

  18. Stage 17: Bash Operators

    • Bash Operators

      Bash operators are special symbols or characters that perform specific actions or comparisons within a Bash script or command line. They are fundamental building blocks for controlling program flow, manipulating data, and performing various operations like arithmetic calculations, string comparisons, file…

    • Arithmetic

      Arithmetic operators in Bash are symbols used to perform mathematical calculations within shell scripts. These operators allow you to add, subtract, multiply, divide, and find the remainder of numbers directly within your scripts, enabling you to perform calculations and manipulate numerical data. Bash primarily…

    • Comparison

      Comparison operators in Bash are used to compare values, typically numbers or strings. These operators allow you to create conditional statements within your scripts, enabling different code blocks to execute based on whether a comparison is true or false. They are fundamental for making decisions and controlling…

    • String operators

      String operators in Bash are symbols or keywords used to perform operations on strings, such as checking if a string is empty, comparing strings, extracting substrings, or determining the length of a string. These operators are essential for manipulating and evaluating string values within shell scripts, enabling…

    • Logical

      Logical operators in Bash are used to combine or modify conditional expressions. They allow you to create more complex tests within your scripts, enabling you to execute commands based on multiple conditions being true or false. The primary logical operators are && (AND), || (OR), and ! (NOT). These operators are…

    • File test

      File test operators in Bash are used to check the type and attributes of files. These operators allow you to determine if a file exists, if it's a regular file or a directory, if it's readable, writable, or executable, and other file-related properties. The result of a file test is a boolean value (true or false),…

  19. Stage 19: Script Arguments

    • Script Arguments

      Script arguments are values passed to a shell script when it is executed. These arguments allow you to customize the script's behavior without modifying the script's code directly. They are accessed within the script using positional parameters like $1, $2, $3, and so on, where $1 represents the first argument, $2…

    • Arithmetic expansion

      Arithmetic expansion allows you to perform mathematical calculations directly within your shell scripts. It uses the $((...)) syntax to evaluate expressions, treating the contents inside the parentheses as an arithmetic expression. This enables you to perform operations like addition, subtraction, multiplication,…

    • expr

      expr is a command-line utility used to evaluate expressions. It can perform arithmetic operations, string manipulations, and logical comparisons. The expr command takes arguments as operands and operators, evaluates the expression, and writes the result to standard output. It's often used in shell scripts for…

    • bc

      bc is a command-line utility for arbitrary-precision arithmetic. It allows you to perform calculations with numbers of any size and with a specified level of decimal precision, making it suitable for tasks where standard shell arithmetic is insufficient. bc can be used interactively or non-interactively, reading…

    • let

      The let command in Bash is used to perform arithmetic operations. It allows you to evaluate arithmetic expressions and assign the result to a variable. It's a way to do integer calculations directly within your shell scripts without needing external commands like expr.

    • awk

      Awk is a powerful text processing tool that can also perform numeric calculations. It reads input line by line and executes a set of instructions for each line. These instructions can include arithmetic operations, comparisons, and variable assignments, making awk useful for tasks like calculating sums, averages,…

    • $1, $2, $3

      Positional parameters in shell scripting are variables that hold the command-line arguments passed to a script. These parameters are represented by special variables like $1, $2, $3, and so on, where each number corresponds to the order in which the argument was provided when the script was executed. $1 holds the…

    • $0

      In shell scripting, $0 is a special variable that holds the name of the script being executed. It essentially represents the command used to invoke the script. This can be the script's filename, or if the script was invoked with a path, it will contain that path. $0 is useful for identifying the script itself…

    • $@

    • $*

    • $#

    • shift

      The shift command in shell scripting renames the command-line arguments. Specifically, it moves each argument one position to the left. The value of $2 becomes $1, the value of $3 becomes $2, and so on. The original value of $1 is lost. This is particularly useful when you need to process a variable number of…

  20. Stage 21: String Manipulation

    • String Manipulation

      String manipulation involves modifying or extracting parts of text data. This can include tasks like finding specific characters, replacing substrings, changing the case of letters, or extracting portions of a string based on delimiters or patterns. These operations are fundamental for processing and transforming…

    • String length

      Determining the length of a string is a common task in scripting. It involves finding the number of characters present in a given string, which can be useful for validation, formatting, or other string processing operations. In shell scripting, there are several ways to achieve this, each with its own syntax and…

    • Substring extraction

      Substring extraction involves selecting a portion of a string based on its position within the string. This is done by specifying the starting point and the length of the desired substring. It allows you to isolate and work with specific parts of a larger text string.

    • Pattern replacement

      Pattern replacement in shell scripting involves finding specific patterns within strings and substituting them with other strings. This is a fundamental text processing technique used to modify and transform data, allowing for tasks like cleaning up input, standardizing formats, or extracting relevant information.…

    • Case conversion

      Case conversion involves changing the case of characters within a string. This typically means converting lowercase letters to uppercase, uppercase letters to lowercase, or applying title case (where the first letter of each word is capitalized). It's a common operation for standardizing data, improving…

  21. Stage 20: Exit Codes

    • Exit Codes

      Exit codes are numerical values returned by a program or script upon completion. These codes signal whether the execution was successful or if any errors occurred. By convention, an exit code of 0 typically indicates success, while any non-zero value signifies a failure or specific error condition. These codes are…

  22. Stage 22: File Permissions

    • File Permissions

      File permissions in Unix-like operating systems, such as Linux and macOS, control who can access and modify files and directories. These permissions are typically represented by three categories: owner, group, and others. Each category can have read, write, and execute permissions, determining what actions users in…

    • $?

    • exit

      Exit codes are numerical values returned by a program or script upon completion. These codes signal whether the execution was successful or if any errors occurred. By convention, an exit code of 0 typically indicates success, while any non-zero value signifies a failure or specific error condition. These codes are…

    • Success vs failure

      Exit codes are numerical values returned by a program or script upon completion, signaling whether it executed successfully or encountered an error. A zero (0) exit code typically indicates success, while any non-zero value signifies failure, with different non-zero codes often representing specific types of…

  23. Stage 23: Conditionals

    • Conditionals

      Conditionals in shell scripting allow you to execute different blocks of code based on whether a certain condition is true or false. This enables your scripts to make decisions and respond dynamically to different situations, making them more versatile and powerful. Common conditional statements include if, elif…

    • rwx

      In Unix-like operating systems, file permissions control who can access and modify files and directories. The "rwx" notation represents the three fundamental permission types: "r" for read, allowing users to view the contents of a file or list the contents of a directory; "w" for write, allowing users to modify a…

    • chmod

      chmod is a command-line utility used to change the access permissions of files or directories. These permissions determine who can read, write, or execute a file. It allows you to control access to your files, ensuring security and proper functionality within a system.

    • chown

      chown is a command-line utility used to change the ownership of files or directories. It allows you to modify the user and/or group associated with a file, effectively controlling who has access and what they can do with it. This is crucial for managing security and access control within a Linux or Unix-like…

    • chgrp

      chgrp is a command-line utility used to change the group ownership of a file or directory. It allows you to specify a new group that should be associated with the file, controlling which users have specific access rights based on group membership. This is a fundamental tool for managing file access and security in…

  24. Stage 24: Loops

    • Loops

      Loops are programming constructs that allow you to repeatedly execute a block of code. They automate repetitive tasks by iterating over a sequence of values or until a certain condition is met. This avoids writing the same code multiple times and makes scripts more efficient and easier to maintain.

    • for

      A "for" loop is a control flow statement that allows you to repeatedly execute a block of code a specific number of times or for each item in a list. It's a fundamental programming construct used to automate repetitive tasks and iterate over collections of data. The loop continues until a specified condition is…

    • while

      A while loop in shell scripting repeatedly executes a block of code as long as a specified condition remains true. It's a fundamental control flow statement that allows you to automate repetitive tasks based on a dynamic condition that can change during the loop's execution. The loop continues iterating until the…

    • until

      An until loop in shell scripting repeatedly executes a block of code as long as a specified condition is false. The loop continues to iterate until the condition becomes true, at which point the loop terminates. It's essentially the opposite of a while loop, providing a way to execute commands until a desired state…

    • break, continue

      break and continue are control flow statements used within loops to alter their execution. The break statement immediately terminates the loop, transferring control to the next statement after the loop. The continue statement skips the rest of the current iteration of the loop and proceeds to the next iteration.

  25. Stage 25: Functions

    • Functions

      Functions in shell scripting are reusable blocks of code that perform a specific task. They allow you to organize your scripts, avoid repetition, and make your code more readable and maintainable. You can define a function, give it a name, and then call it multiple times throughout your script, passing arguments if…

    • Function Scopes

      Function scope determines the visibility and accessibility of variables within a function. In shell scripting, variables can have either global or local scope. Global variables are accessible from anywhere in the script, including within functions, while local variables are only accessible within the function where…

    • Recursive Functions

      Recursive functions are functions that call themselves within their own definition. This allows a function to repeat a process until a specific condition is met, breaking down a complex problem into smaller, self-similar subproblems. Each call adds a new layer to the execution stack, and it's crucial to have a base…

  26. Stage 26: Debugging

    • Debugging

      Debugging is the process of identifying and removing errors or defects from software code. It involves systematically testing, analyzing, and correcting issues that cause a program to behave unexpectedly or produce incorrect results. Effective debugging relies on using tools and techniques to trace the flow of…

    • set -x

      set -x is a debugging tool used in shell scripts to trace the execution of commands. When enabled, the shell will print each command to standard error (stderr) before it is executed, preceded by a + symbol. This allows you to see exactly what commands are being run and in what order, making it easier to identify…

    • bash -n

      The bash -n option is a debugging tool that allows you to perform a syntax check on your Bash script without actually executing it. This is useful for identifying errors like typos, missing keywords, or incorrect syntax before running the script and potentially causing unintended consequences. It essentially parses…

    • shellcheck

      Shellcheck is a static analysis tool for shell scripts. It helps identify and fix common syntax errors, semantic issues, and stylistic problems in your Bash/Shell scripts before you even run them. By analyzing your code, shellcheck can suggest improvements and help prevent potential bugs, resulting in more robust…

    • Bash Debug

      The Bash Debug extension for VS Code, powered by bashdb, allows you to debug Bash scripts directly within the VS Code editor. It provides features like breakpoints, stepping through code, inspecting variables, and evaluating expressions, making it easier to identify and fix errors in your Bash scripts. This helps…

    • if

      The if statement in shell scripting allows you to execute different blocks of code based on whether a certain condition is true or false. It's a fundamental control flow mechanism that enables scripts to make decisions and behave differently depending on the input or state of the system. The if statement evaluates…

    • case

      Case statements provide a way to execute different blocks of code based on the value of a variable or expression. They offer a structured alternative to multiple if-elif-else statements, making code more readable and maintainable when dealing with several possible conditions. Each condition is associated with a…

  27. Stage 27: Error Handling

    • Error Handling

      Error handling in shell scripting refers to the methods and techniques used to detect, manage, and respond to errors that occur during the execution of a script. It involves checking the exit status of commands, using conditional statements to handle different error scenarios, and implementing mechanisms to…

  28. Stage 28: Regular Expressions

    • Regular Expressions

      Regular expressions (regex) are sequences of characters that define a search pattern. They are used to match, locate, and manipulate text based on specific patterns. Regex provides a powerful way to search for strings that match a certain format, such as email addresses, phone numbers, or specific keywords within a…

    • Basic regex syntax

      Regular expressions (regex) are sequences of characters that define a search pattern. They are used to match, locate, and manipulate text based on patterns. Basic regex syntax involves using special characters and metacharacters to represent different types of patterns, such as specific characters, character…

    • Extended regex

      Extended regular expressions (EREs) are a more powerful and flexible version of basic regular expressions. They offer additional metacharacters and features that simplify pattern matching and make complex searches easier to express. EREs are commonly used with tools like grep -E, awk, and sed -E in shell scripting.

  29. Stage 29: Process Management

    • Process Management

      Process management involves controlling and monitoring the execution of programs within an operating system. It includes tasks such as creating new processes, scheduling their execution, allocating resources, and handling inter-process communication. Effective process management ensures efficient utilization of…

    • set -e

      set -e is a shell command that instructs the shell to exit immediately if a command exits with a non-zero status. This is a way to ensure that your script stops executing as soon as an error occurs, preventing subsequent commands from running based on potentially incorrect or incomplete results. It's a common…

    • set -o

      The set -o command in shell scripting is used to modify shell options, which control the behavior of the shell. These options can affect how the shell interprets commands, handles errors, and performs other tasks. By using set -o with specific option names, you can customize the shell's environment to suit your…

    • set -u

      The set -u command in shell scripting treats unset variables as an error. When this option is enabled, the script will exit immediately if it tries to use a variable that has not been assigned a value. This helps to catch potential bugs caused by typos or missing variable assignments, making scripts more robust.

    • trap

      trap is a shell command used to specify actions to be taken upon receiving signals. Signals are notifications sent to a process to indicate an event, such as termination, interruption, or an error. The trap command allows you to define custom handlers that execute when a specific signal is received, enabling you to…

    • Error logging

      Error logging is the process of recording errors that occur during the execution of a script or program. This involves capturing information about the error, such as the type of error, the time it occurred, and the location in the code where it happened. Effective error logging facilitates debugging,…

  30. Stage 30: Package Management

    • Package Management

      Package management is the process of installing, updating, configuring, and removing software packages on a computer system. It provides a standardized way to handle software dependencies, ensuring that all necessary components are present and compatible. Package managers also simplify the process of keeping…

    • jobs

      In a shell environment, a job represents a process or a group of processes that are running in the background or foreground. The jobs command provides a way to list the currently active jobs, check their status (running, stopped, terminated), and manage them, such as bringing them to the foreground or terminating…

    • nohup

      nohup is a command-line utility used to run a command immune to hangups, with output redirected to a file. This allows a process to continue running in the background even after the user who started the process logs out or closes the terminal. It's particularly useful for long-running tasks that shouldn't be…

    • fg, bg

      fg and bg are shell commands used to manage processes. bg moves a process to the background, allowing you to continue using the terminal while the process runs. fg brings a background process to the foreground, giving it control of the terminal. This is useful for managing long-running tasks or temporarily pausing…

    • disown

      disown is a shell built-in command used to remove jobs from the shell's job control. When you start a process in the background (using &), the shell keeps track of it. If you close the terminal, the shell usually sends a SIGHUP signal to these background processes, which often causes them to terminate. disown…

    • Process substitution

      Process substitution allows you to treat the output of a process as if it were a file. It achieves this by creating a temporary file (or using a pipe in some systems) and connecting the standard output of a command to it. This temporary file's name is then substituted into the command line, allowing commands that…

    • ping

      Ping is a command-line utility used to test the reachability of a host on an Internet Protocol (IP) network. It works by sending Internet Control Message Protocol (ICMP) "echo request" packets to the target host and waiting for ICMP "echo reply" packets. The ping command measures the round-trip time (RTT) for these…

    • curl

      curl is a command-line tool used to transfer data with URLs. It supports various protocols like HTTP, HTTPS, FTP, and more, allowing you to download files, send data to servers, and interact with APIs directly from the command line. It's a versatile tool for automating tasks involving network communication.

    • wget

      wget is a command-line utility used to retrieve files from the internet. It supports downloading files using HTTP, HTTPS, and FTP protocols. wget is non-interactive, meaning it can work in the background without user intervention, making it suitable for scripting and automation.

    • ssh

      SSH (Secure Shell) is a cryptographic network protocol that enables secure communication between two computers over an insecure network. It's commonly used for remote command-line access, remote execution of commands, and secure file transfer. SSH encrypts the data transmitted between the client and the server,…

    • scp

      scp, short for secure copy, is a command-line utility that allows you to securely transfer files between a local host and a remote host or between two remote hosts. It uses the SSH protocol for data transfer, ensuring that the data is encrypted during transmission, thus protecting it from eavesdropping. scp is…

    • rsync

      rsync is a command-line utility for efficiently transferring and synchronizing files between a computer and an external hard drive or across networked computers. It minimizes data transfer by only copying the differences between the source and destination, making it faster than simple copy commands, especially for…

    • netstat, ss

      netstat and ss are command-line tools used to display network connections, routing tables, interface statistics, masquerade connections, and multicast memberships. They provide insights into the network activity of a system, allowing users to diagnose network issues, monitor connections, and understand network…

    • ifconfig, ip

      ifconfig and ip are command-line utilities used to configure and manage network interfaces on Unix-like operating systems. They allow you to view, configure, and control network interfaces, including assigning IP addresses, setting network masks, and enabling or disabling interfaces. While ifconfig is an older…

    • ps

      ps is a command-line utility that displays information about active processes running on a Linux or Unix-like operating system. It provides a snapshot of the current processes, including their process IDs (PIDs), resource usage, and other relevant details. This allows users and administrators to monitor system…

    • top, htop

      top and htop are command-line utilities used for real-time system monitoring. They display a dynamic, ordered list of processes running on a system, along with information about CPU usage, memory consumption, and other system resources. htop is an enhanced, interactive version of top, offering features like…

    • free

      free is a command-line utility used to display the amount of free and used physical and swap memory in a system. It provides a snapshot of the memory usage at a given point in time, showing total memory, used memory, free memory, shared memory, buffer/cache memory, and available memory. This information is crucial…

    • df, du

      df (disk free) and du (disk usage) are command-line utilities used to monitor disk space on Unix-like operating systems. df provides a summary of available and used disk space on mounted file systems, while du estimates the file space usage of files and directories. Together, they help system administrators…

    • uptime

      Uptime is a command-line utility that displays how long the system has been running. It provides a concise summary of the current time, how long the system has been up, the number of users currently logged in, and the system's load average over the past 1, 5, and 15 minutes. This information is useful for quickly…

    • iostat, vmstat

      iostat and vmstat are command-line utilities used for system monitoring. iostat reports CPU utilization and disk I/O statistics, providing insights into storage device performance. vmstat reports virtual memory statistics, including information about processes, memory, paging, block I/O, traps, and CPU activity,…

    • apt

      apt (Advanced Package Tool) is a command-line package management system used primarily on Debian-based Linux distributions like Ubuntu. It simplifies the process of installing, updating, removing, and managing software packages by retrieving them from configured repositories and handling dependencies automatically.…

    • brew

      Homebrew is a package manager for macOS (and Linux). It simplifies the installation of software on these operating systems by automating the process of downloading, compiling, and installing software packages from the command line. It's often used to install tools and utilities that aren't included by default in…

    • yum

      yum (Yellowdog Updater, Modified) is a command-line package management tool for systems using the RPM Package Manager. It automates the process of installing, updating, removing, and searching for software packages and their dependencies from configured repositories. yum simplifies software management by resolving…

    • dnf

      dnf is a package manager for RPM-based Linux distributions, serving as the successor to YUM (Yellowdog Updater, Modified). It is used to install, update, and remove software packages, as well as manage dependencies. dnf aims to improve upon YUM by offering better performance, more features, and a more modern…

    • tar

      tar (Tape Archive) is a command-line utility in Unix-like operating systems used for archiving and extracting files. It combines multiple files into a single archive file, often referred to as a "tarball." While tar itself doesn't compress the archive, it's commonly used in conjunction with compression tools like…

    • zip, unzip

      zip and unzip are command-line utilities used for compressing and decompressing files and directories. zip packages files into a single archive, reducing their size and making them easier to share or store. unzip extracts the contents of a zip archive, restoring the original files and directories.

    • gzip, gunzip

      gzip is a command-line utility used to compress files, reducing their size and making them easier to store or transmit. The compressed files typically have a .gz extension. gunzip is the corresponding command used to decompress files that have been compressed with gzip, restoring them to their original state.

    • bzip2, xz

      bzip2 and xz are command-line tools used for file compression in Unix-like operating systems. They reduce the size of files, making them easier to store and transfer. bzip2 generally offers higher compression than gzip but is slower, while xz provides even better compression ratios and is often used for…

    • cron, crontab

      cron is a time-based job scheduler in Unix-like operating systems. It allows users to schedule tasks (commands or scripts) to run automatically at specific times, dates, or intervals. The crontab (cron table) is a file that contains the schedule of cron jobs for a user. Each user has their own crontab file, and the…

    • at

      The at command in Unix-like operating systems is used to schedule commands to be executed at a specific time. It allows you to specify a time and date, and then provide a command that will be run automatically at that designated time. This is useful for automating tasks that need to be performed at a later time…

    • systemd timers

      Systemd timers are a systemd feature that allows you to schedule tasks to run at specific times or intervals, similar to cron. They provide a more flexible and powerful alternative to cron, offering features like dependency management, event-based activation, and integration with systemd's logging and service…

Questions about the Shell / Bash Roadmap

Is the Shell / Bash Roadmap free?

Yes. All 166 lessons in this roadmap are free to read on Bibha AI Learning Labs, with no account and no payment. Signing in is optional: it lets you mark lessons as done and keep your progress, and it opens the AI tutor, which runs on your own API key.

How long does the Shell / Bash Roadmap take?

There is no fixed duration. It has 166 lessons in 30 stages, and the time it takes depends on how many hours you give it each week. Nothing is locked, so you can skip what you already know, and your progress is saved once you sign in.

Where should I start the Shell / Bash Roadmap?

Start with stage 1, Introduction, and work down in order. The stages are numbered in the order the roadmap suggests, but every lesson is open, so if you already know Introduction you can go straight to Popular Shells or anything after it. Each lesson links to free resources for going deeper.

Can I learn Shell / Bash in Hindi?

The lessons are written in English. Once you sign in, you can ask the AI tutor on any lesson to explain it in Hindi or Hinglish. It answers from that lesson’s own text, so the explanation stays on the syllabus. The tutor runs on your own Google, OpenAI or Anthropic key.

Still confused? Ask me