The Notes for Professionals book is compiled from Stack Overflow Documentation, the content is written by the beautiful people at Stack Overflow. Text content is released under Creative Commons BY-SA. See credits at the end of this book whom contributed to the various chapters. Images may be copyright of their respective owners unless otherwise specified
Book created for educational purposes and is not affiliated with group(s), company(s) nor Stack Overflow. All trademarks belong to their respective company owners
https://goalkicker.com/
Content
1-1Content list
1-2About
1-3Chapter 1: Getting started with Bash
1-4Section 1.1: Hello World
1-5Section 1.2: Hello World Using Variables
1-6Section 1.3: Hello World with User Input
1-7Section 1.4: Importance of Quoting in Strings
1-8Section 1.5: Viewing information for Bash built-ins
1-9Section 1.6: Hello World in "Debug" mode
1-10Section 1.7: Handling Named Arguments
1-11Chapter 2: Script shebang
1-12Section 2.1: Env shebang
1-13Section 2.2: Direct shebang
1-14Section 2.3: Other shebangs
1-15Chapter 3: Navigating directories
1-16Section 3.1: Absolute vs relative directories
1-17Section 3.2: Change to the last directory
1-18Section 3.3: Change to the home directory
1-19Section 3.4: Change to the Directory of the Script
1-20Chapter 4: Listing Files
1-21Section 4.1: List Files in a Long Listing Format
1-22Section 4.2: List the Ten Most Recently Modified Files
1-23Section 4.3: List All Files Including Dotfiles
1-24Section 4.4: List Files Without Using `ls`
1-25Section 4.5: List Files
1-26Section 4.6: List Files in a Tree-Like Format
1-27Section 4.7: List Files Sorted by Size
1-28Chapter 5: Using cat
1-29Section 5.1: Concatenate files
1-30Section 5.2: Printing the Contents of a File
1-31Section 5.3: Write to a file
1-32Section 5.4: Show non printable characters
1-33Section 5.5: Read from standard input
1-34Section 5.6: Display line numbers with output
1-35Section 5.7: Concatenate gzipped files
1-36Chapter 6: Grep
1-37Section 6.1: How to search a file for a pattern
1-38Chapter 7: Aliasing
1-39Section 7.1: Bypass an alias
1-40Section 7.2: Create an Alias
1-41Section 7.3: Remove an alias
1-42Section 7.4: The BASH_ALIASES is an internal bash assoc array
1-43Section 7.5: Expand alias
1-44Section 7.6: List all Aliases
1-45Chapter 8: Jobs and Processes
1-46Section 8.1: Job handling
1-47Section 8.2: Check which process running on specific port
1-48Section 8.3: Disowning background job
1-49Section 8.4: List Current Jobs
1-50Section 8.5: Finding information about a running process
1-51Section 8.6: List all processes
1-52Chapter 9: Redirection
1-53Section 9.1: Redirecting standard output
1-54Section 9.2: Append vs Truncate
1-55Section 9.3: Redirecting both STDOUT and STDERR
1-56Section 9.4: Using named pipes
1-57Section 9.5: Redirection to network addresses
1-58Section 9.6: Print error messages to stderr
1-59Section 9.7: Redirecting multiple commands to the same file
1-60Section 9.8: Redirecting STDIN
1-61Section 9.9: Redirecting STDERR
1-62Section 9.10: STDIN, STDOUT and STDERR explained
1-63Chapter 10: Control Structures
1-64Section 10.1: Conditional execution of command lists
1-65Section 10.2: If statement
1-66Section 10.3: Looping over an array
1-67Section 10.4: Using For Loop to List Iterate Over Numbers
1-68Section 10.5: continue and break
1-69Section 10.6: Loop break
1-70Section 10.7: While Loop
1-71Section 10.8: For Loop with C-style syntax
1-72Section 10.9: Until Loop
1-73Section 10.10: Switch statement with case
1-74Section 10.11: For Loop without a list-of-words parameter
1-75Chapter 11: true, false and : commands
1-76Section 11.1: Infinite Loop
1-77Section 11.2: Function Return
1-78Section 11.3: Code that will always/never be executed
1-79Chapter 12: Arrays
1-80Section 12.1: Array Assignments
1-81Section 12.2: Accessing Array Elements
1-82Section 12.3: Array Modification
1-83Section 12.4: Array Iteration
1-84Section 12.5: Array Length
1-85Section 12.6: Associative Arrays
1-86Section 12.7: Looping through an array
1-87Section 12.8: Destroy, Delete, or Unset an Array
1-88Section 12.9: Array from string
1-89Section 12.10: List of initialized indexes
1-90Section 12.11: Reading an entire file into an array
1-91Section 12.12: Array insert function
1-92Chapter 13: Associative arrays
1-93Section 13.1: Examining assoc arrays
1-94Chapter 14: Functions
1-95Section 14.1: Functions with arguments
1-96Section 14.2: Simple Function
1-97Section 14.3: Handling flags and optional parameters
1-98Section 14.4: Print the function definition
1-99Section 14.5: A function that accepts named parameters
1-100Section 14.6: Return value from a function
1-101Section 14.7: The exit code of a function is the exit code of its last command
1-102Chapter 15: Bash Parameter Expansion
1-103Section 15.1: Modifying the case of alphabetic characters
1-104Section 15.2: Length of parameter
1-105Section 15.3: Replace pattern in string
1-106Section 15.4: Substrings and subarrays
1-107Section 15.5: Delete a pattern from the beginning of a string
1-108Section 15.6: Parameter indirection
1-109Section 15.7: Parameter expansion and filenames
1-110Section 15.8: Default value substitution
1-111Section 15.9: Delete a pattern from the end of a string
1-112Section 15.10: Munging during expansion
1-113Section 15.11: Error if variable is empty or unset
1-114Chapter 16: Copying (cp)
1-115Section 16.1: Copy a single file
1-116Section 16.2: Copy folders
1-117Chapter 17: Find
1-118Section 17.1: Searching for a file by name or extension
1-119Section 17.2: Executing commands against a found file
1-120Section 17.3: Finding file by access / modification time
1-121Section 17.4: Finding files according to size
1-122Section 17.5: Filter the path
1-123Section 17.6: Finding files by type
1-124Section 17.7: Finding files by specific extension
1-125Chapter 18: Using sort
1-126Section 18.1: Sort command output
1-127Section 18.2: Make output unique
1-128Section 18.3: Numeric sort
1-129Section 18.4: Sort by keys
1-130Chapter 19: Sourcing
1-131Section 19.1: Sourcing a file
1-132Section 19.2: Sourcing a virtual environment
1-133Chapter 20: Here documents and here strings
1-134Section 20.1: Execute command with here document
1-135Section 20.2: Indenting here documents
1-136Section 20.3: Create a file
1-137Section 20.4: Here strings
1-138Section 20.5: Run several commands with sudo
1-139Section 20.6: Limit Strings
1-140Chapter 21: Quoting
1-141Section 21.1: Double quotes for variable and command substitution
1-142Section 21.2: Dierence between double quote and single quote
1-143Section 21.3: Newlines and control characters
1-144Section 21.4: Quoting literal text
1-145Chapter 22: Conditional Expressions
1-146Section 22.1: File type tests
1-147Section 22.2: String comparison and matching
1-148Section 22.3: Test on exit status of a command
1-149Section 22.4: One liner test
1-150Section 22.5: File comparison
1-151Section 22.6: File access tests
1-152Section 22.7: Numerical comparisons
1-153Chapter 23: Scripting with Parameters
1-154Section 23.1: Multiple Parameter Parsing
1-155Section 23.2: Argument parsing using a for loop
1-156Section 23.3: Wrapper script
1-157Section 23.4: Accessing Parameters
1-158Section 23.5: Split string into an array in Bash
1-159Chapter 24: Bash history substitutions
1-160Section 24.1: Quick Reference
1-161Section 24.2: Repeat previous command with sudo
1-162Section 24.3: Search in the command history by pattern
1-163Section 24.4: Switch to newly created directory with !#:N
1-164Section 24.5: Using !$
1-165Section 24.6: Repeat the previous command with a substitution
1-166Chapter 25: Math
1-167Section 25.1: Math using dc
1-168Section 25.2: Math using bash capabilities
1-169Section 25.3: Math using bc
1-170Section 25.4: Math using expr
1-171Chapter 26: Bash Arithmetic
1-172Section 26.1: Simple arithmetic with (( ))
1-173Section 26.2: Arithmetic command
1-174Section 26.3: Simple arithmetic with expr
1-175Chapter 27: Scoping
1-176Section 27.1: Dynamic scoping in action
1-177Chapter 28: Process substitution
1-178Section 28.1: Compare two files from the web
1-179Section 28.2: Feed a while loop with the output of a command
1-180Section 28.3: Concatenating files
1-181Section 28.4: Stream a file through multiple programs at once
1-182Section 28.5: With paste command
1-183Section 28.6: To avoid usage of a sub-shell
1-184Chapter 29: Programmable completion
1-185Section 29.1: Simple completion using function
1-186Section 29.2: Simple completion for options and filenames
1-187Chapter 30: Customizing PS1
1-188Section 30.1: Colorize and customize terminal prompt
1-189Section 30.2: Show git branch name in terminal prompt
1-190Section 30.3: Show time in terminal prompt
1-191Section 30.4: Show a git branch using PROMPT_COMMAND
1-192Section 30.5: Change PS1 prompt
1-193Section 30.6: Show previous command return status and time
1-194Chapter 31: Brace Expansion
1-195Section 31.1: Modifying filename extension
1-196Section 31.2: Create directories to group files by month and year
1-197Section 31.3: Create a backup of dotfiles
1-198Section 31.4: Use increments
1-199Section 31.5: Using brace expansion to create lists
1-200Section 31.6: Make Multiple Directories with Sub-Directories