Glossary

A

Abstraction is a software module, application, or library that replicates the basic properties of some object. Abstractions help to manage the complexity of software systems. They hide irrelevant details. Abstractions allow the same algorithm to handle different objects.

Algorithm is a finite sequence of instructions that are understandable for the executor. The goal of an algorithm is to calculate something or solve a specific task.

Alias is a built-in Bash command for shortening long strings in the user input. You can apply this command when Bash works in the shell mode.

Application programming interface (API) is a set of agreements on interaction components of the information system. The agreements answer the following questions:

  • What function does the called component performs?
  • What data does the function need on the input?
  • What data does the function return on the output?

Argument is a word or string that the program receives via the command-line interface. Here is an example of two arguments for the grep utility:

grep "GNU" README.txt

Arithmetic expansion calculates an arithmetic expression and substitutes its result into the Bash command or statement. Here is an example of the expansion:

echo $((4+3))

Array is a data structure that consists of a set of elements. Their positions are defined by the sequence numbers or indexes. The array elements are placed one after another in computer memory.

ASCII is an eight-bit character encoding standard. It includes the following characters:

  • Decimal digits
  • Latin alphabet
  • National alphabet
  • Punctuation marks
  • Control characters

Asynchrony means events that occur independently of the main program flow. Asynchrony also means the methods for processing such events.

B

Background is a mode of Bash for process execution. When you apply this mode, the process identifier does not belong to the identifier group of the terminal. Also, the executed process does not handle keyboard interrupts in the terminal window.

Bash (Bourne again shell) is a command-line interpreter developed by Brian Fox. Bash has replaced the Bourne shell in Linux distributions and some proprietary Unix systems. Bash is compatible with the POSIX standard. However, the standard does not include some features of the interpreter.

Bash script is a text file that contains commands for the interpreter. Bash executes scripts in the non-interactive mode.

Best practices are recommended approaches for using a programming language or technology. An example of best practice for Bash is enclosing strings in double quotes to avoid word splitting.

Bottleneck is a component or resource of a computer system that limits its performance.

Boolean expression is a programming language construct. When calculated, It results in either the “true” or “false” value.

Bourne shell is a command-line interpreter developed by Stephen Bourne. It replaced the original Ken Thompson’s interpreter in Unix version 7. The POSIX standard contains all features of the Bourne shell. However, the shell misses some features from the standard.

Brace expansion is a Bash mechanism for generating words from given parts. The POSIX standard misses this mechanism.
Here is an example of the brace expansion:

cp test.{txt,md,log} Documents

Bash generates the following command from it:

cp test.txt test.md test.log Documents

Builtin commands are the built-in commands that the interpreter executes by itself. It does not call utilities or programs for that. An example is pwd.

C

Child process is a process spawned by another process called the parent.

Code base is a collection of source code used to build a software system or application. It does not contain generated code by tools.

Code style is a set of rules and conventions for writing the program source code. These rules help several programmers write, read, and manage their code base.

Command is the text entered after the command prompt. This text defines the action that the interpreter should perform. If the interpreter cannot do the specified action, it can call another application for that.

Command-line parameter is a type of command argument that passes information to the program. The parameter can also be a part of some option. For example, it specifies the program working mode.
Here is the find utility call with two parameters:

find ~/Documents -name README

The first parameter ~/Documents specifies the path where the search starts. The second parameter README refers to the option -name. It specifies the file or directory name for searching.

Command prompt is a sequence of characters. The shell prints a prompt when it is ready to process a user command.

Command substitution is the Bash mechanism that replaces a command call to its output. The subshell executes the command call.
Here is an example of the command substitution:

echo "$(date)"

Compiler is a program for translating source code from some programming language to machine code.

Computer program is a set of instructions that a computer can execute. Each program solves a specific applied task.

Conditional statement is a construct of a programming language. This statement chooses a block of commands to execute depending on the result of the Boolean expression.

Control character is a separate character in the escape sequence.

Control flow is an order in which the program executes its instructions and functions.

E

Endianness is the byte order that the computer uses to store numbers in memory. The CPU defines the supported endianness. There are two commonly used byte orders: big-endian and little-endian. Some CPUs support both (bi-endian).
Here is an example of representing the four-byte number 0x0A0B0C0D in different byte orders:

0A 0B 0C 0D     big-endian
0D 0C 0B 0A     little-endian

Environment variables is an unordered set of variables that the child process copies from the parent one. The env utility can set environment variables when a program starts. If you call the utility without parameters, it prints all variables declared in the current shell.

Error-prone (error-prone) means failed programming techniques and solutions. These solutions work correctly in particular cases. However, they cause errors with specific input data or conditions.
An example of an error-prone solution is handling the ls utility output in the pipeline like this:

ls | grep "test"

Escape sequence is a set of characters that have no meaning of their own. Instead, they control the output device. For example, the line break character \n commands the output device to start a new line.

Exit code (or exit status) is an integer value from 0 to 255 that the shell command returns when finishing. The zero status means successful execution of the command. All other codes indicate an error.

F

File descriptor is an abstract pointer to some file or communication channel (stream, pipeline or network socket). Descriptors are part of the POSIX interface. Non-negative integers represent them.

Filename expansion is a Bash mechanism that replaces patterns with filenames. A pattern can contain the following wildcards: ?, *, [.
Here is an example of using the filename expansion:

rm -rf *

Filename extension is a suffix of the filename. The extension defines a file type.

File system is a set of rules to store and read data from a storage device. Also, a file system means a component of OS to manage storage devices.

Foreground is a default process execution mode in Bash. When you apply it, the process identifier belongs to the identifier group of the terminal. The executed process handles keyboard interrupts in the terminal window.

Function is a modern name for a subroutine.

G

General-purpose programming language is a language that you can use to develop applications for various applied domains. It does not contain constructs that are useful in one domain and useless in others.

Globbing or glob is another name for the filename expansion mechanism of Bash.

Glob pattern is a search query. It includes regular and wildcard characters (* and ?). The wildcards correspond to any characters.
For example, the “R*M?” pattern matches strings that begin with R and whose penultimate letter is M.

H

Hash function generates a unique sequence of bytes from the input data.

[ calculates the keys for added elements.

I

Idiom is a way to express some statement using a specific programming language. An idiom can be a template for implementing an algorithm or data structure.
Here is the Bash idiom for using patterns when processing files in the for loop:

1 for file in ./*.txt
2 do
3   cp "$file" ~/Documents
4 done

Input field separator (IFS) is a list of characters. Bash uses them as separators when processing input strings. For example, it uses them for word splitting. The default separators are space, tab and a line break.

Interpreter is a program that executes instructions. They are written in a programming language. The interpreter allows you to execute them without compilation.

Iteration is a single execution of a command block in the loop body.

L

Library is a collection of subroutines and data structures assembled into a standalone module. Applications use libraries as building blocks.

Linked list is a data structure that consists of elements called nodes. Their positions in the list do not match their placement in memory. Therefore, each node has a pointer to the next one. Such list organization makes insertion and deletion operations effective.

Linux distribution is an operating system based on the Linux kernel and the GNU packages. Such an OS is assembled from open-source programs and libraries.

Linux environment is another name for a POSIX environment.

Literal is a notation for some fixed value in the source code of a program. There are different ways to write literals depending on their data types. Most programming languages support literals for integers, floating point numbers and strings.
Here is an example of the string literal ~/Documents in Bash:

1 var="~/Documents"

Logical operator is an operation on one or more Boolean expressions. The operation can combine them into a single expression.

M

Multiprogramming is a technique for distributing computer resources among several programs.
For example, a program runs until it needs some busy resource. Then OS switches to another program. It comes back to the first program when the required resource becomes free.

Multitasking is the execution of several tasks (processes) in parallel. The OS does it by switching between tasks frequently and executing them in parts.

N

Network protocol agrees on the format of messages between nodes of a computer network.

O

Operand is an argument of some operation or command. It represents the data to be processed.
Here is an example of operands 1 and 4 for the addition operation:

1 + 4

Option is an argument in a standardized form, which the program receives as input. Options of GNU utilities begin with a dash - or a double dash --. Each option sets a specific mode of the program. You can combine successive options into one group.
Here is an example of grouping the -l, -a and -h options of the ls utility:

ls -lah

P

Parameter is an entity that transfers some value from one part of the system to another. A parameter may have no name, unlike a variable.

Parameter expansion is the Bash mechanism that replaces a variable name with its value.
Here are two examples of the parameter expansion:

echo "$PATH"
echo "${var:-empty}"

Pipeline is a process communication mechanism of Unix-like operating systems. The mechanism is based on passing messages. Also, the pipeline means two or more processes with connected input and output streams. OS sends the output stream of one process directly to the input stream of another.

Portable operating system interface (POSIX) is a set of standards. They describe the API of a portable OS, its shell and the utility interfaces. POSIX guarantees compatibility of OSes from the Unix family. This compatibility allows you to move programs between systems with minimal efforts.

Positional parameters contain all command-line arguments that the Bash script receives as input. Parameter names match the order of arguments.
Here is an example of using the first positional parameter in a script:

cp "$1" ~

POSIX environment is a software environment that is compatible with the POSIX standard. The full compatibility is available only when the OS kernel, shell and file system follow POSIX. Environments like Cygwin provide partial compatibility.

POSIX shell is a standard for POSIX systems that describes a minimum set of shell features. If the shell provides these features, it is considered POSIX compatible. The standard does not restrict additional features and extensions. The standard is based on the ksh88 implementation of the Korn shell. This interpreter appeared later than the Bourne shell. Therefore, the Bourne shell misses some features of the POSIX standard.

Process is an instance of a computer program that the CPU executes.

Process substitution is the Bash mechanism that resembles command substitution. It executes the command and provides its output to the Bash process. The mechanism transfers data via temporary files.
Here is an example of using process substitution:

diff <(sort file1.txt) <(sort file2.txt)

Programming paradigm is a set of ideas, methods and principles that dictate how to write programs.

Q

Quote removal is the Bash mechanism that removes the following three unescaped characters from the strings: \ ‘ “.

R

Recursion is a case when some function calls itself. This case is called the direct recursion. The indirect recursion happens when the function calls itself through other functions.

Redirections are the special shell constructs that redirect I/O streams of executed commands. You should specify file descriptors as the source and target for a redirection. A descriptor can point to a file or standard stream.
Here is an example of redirecting the find utility output to the result.txt file:

find / -path */doc/* -name README 1> result.txt

Reserved variables mean the same as shell variables.

S

Scope is a part of a program or system where the variable name and value remain associated with each other. In other words, the program can convert the variable name into the memory address inside the scope. This conversion does not work outside the scope.

Shebang is a sequence of a number sign and exclamation mark (#!) at the beginning of the script. The program loader treats the string after shebang as the interpreter name. The loader launches the interpreter and passes the script to it for execution.
Here is an example of shebang for the Bash script:

1 #!/bin/bash

Shell options change the interpreter behavior. They affect both shell and script modes. The built-in set command sets these options.
For example, here is the command to enable the debug output from the interpreter:

set -x

Shell parameter is a named area of the shell memory for storing data.

Shell variables are set by the shell (for example, PATH). They store temporary data, settings and states of the OS or Unix environment. A user can read these variables. Only some of them are writable. The set command prints all shell variables.

Short-circuit evaluation (short-circuit) is the approach to limit calculations when deducing Boolean expression. The idea is to calculate only those operands that are sufficient to deduce the whole expression.

Special parameters are set by the shell. They perform the following tasks:

  1. Store the shell state.
  2. Pass parameters to the called program.
  3. Store the exit status of the finished program.

Special parameters are read-only. An example of such a parameter is $?.

Standard streams are software channels of communication between a program and the environment where it operates. Streams are abstractions of physical channels of input from the keyboard and output to the screen. You can operate the channels via their descriptors. OS assigns these descriptors.

Subroutine is a fragment of a program that performs a single task. This fragment is an independent code block. It can be called from any place of the program.

Subshell is a way of grouping shell commands. A child process executes the grouped commands. Variables defined in the child process are not available in the parent process.
Here is an example of executing commands in a subshell:

(ps aux | grep "bash")

Symbolic link is a special type of file. Instead of data, it contains a pointer to another file or directory.

Synchronous means events or actions that occur in the main program flow.

T

Tilde expansion (tilde expansion) is the Bash mechanism that replaces the ~ character with the user home directory. The shell takes the path to this directory from the HOME variable.

Time-sharing is a computer mode when several users utilize its resources simultaneously. This mode is based on multitasking and multiprogramming.

U

Unix environment is another name for the POSIX environment.

Utility software is a special program for managing the OS or hardware.

V

Variable is an area of memory that can be accessed by its name.
There is another meaning of this term for Bash. A variable is a parameter that is accessible by its name. The user or the interpreter defines variables.
Here is an example of the variable declaration:

filename="README.txt"

Vulnerability is a bug or flaw of the computing system. An attacker can perform unauthorized actions using the vulnerability.

W

Word splitting is the Bash mechanism that splits command-line arguments into words. Then Bash passes these words to the command as separate parameters. The mechanism uses the characters from the IFS variable as delimiters. It skips arguments that are enclosed in quotes.
Here is an example of a command where word splitting takes place:

cp file1.txt file2.txt "my file.txt" ~