Go to Preview Lesson
Go to Preview Lesson
LESSON 17.4
Make Bash Treat Undefined Variables as Errors With nounset
LESSON 17.5
How to Set Bash pipefail to Add Exit Codes to Scripts
The newline Guide to Bash Scripting
MODULE 1
Introduction
LESSON 1.1
About this book
LESSON 1.2
Community and Code Downloads
LESSON 1.3
Organization of this book
LESSON 1.4
Conventions used in this book
LESSON 1.5
Development environment
LESSON 1.6
Acknowledgements
LESSON 1.7
About the author
MODULE 2
Self–Help
LESSON 2.1
Find Bash Keyword, Function, and Builtin Command Documentation
LESSON 2.2
How to Use man bash and help to Learn About Bash Commands
LESSON 2.3
How to Find Information About Bash File Commands With --help
LESSON 2.4
The Best References for Bash Commands
LESSON 2.5
How to Find Package Specific Bash Documentation
LESSON 2.6
How to Read a Synopsis and Understand Bash Documentation
LESSON 2.7
How to Use apropos to Find Bash Commands (with examples)
MODULE 3
Running Scripts
LESSON 3.1
How to Run a Bash Script Explicitly as an Argument in Terminal
LESSON 3.2
How to Run a Bash Script With a Shebang Line and the Script Path
LESSON 3.3
The Simplest Way to Run a Bash Script with $PATH
MODULE 4
Editing Commands and Scripts
LESSON 4.1
How to Use Bash Readline to Edit Commands and Scripts
LESSON 4.2
How to Edit Bash Scripts in Nano and Vim
MODULE 5
Copying and Pasting
LESSON 5.1
Copying and Pasting
LESSON 5.2
How to Select Text in Linux Terminal With a Mouse
LESSON 5.3
How to Copy and Paste in Linux Terminal With Keyboard Shortcuts
LESSON 5.4
How to Copy and Paste Text With the xclip Bash Command
LESSON 5.5
How to Copy Formatted Text as HTML From Linux Terminal
LESSON 5.6
How to Paste Text in Linux Terminal Safely
MODULE 6
Listing Files
LESSON 6.1
Listing Files
LESSON 6.2
Using Linux ls Command to List Files and grep to Search for Files
LESSON 6.3
How to Glob, Find Pattern Matching Files, and Run Commands
MODULE 7
Text
LESSON 7.1
Text
LESSON 7.2
How to Convert Windows Newlines For Bash With dos2unix
LESSON 7.3
How to Convert Text to UTF-8 And Other Encodings in Bash Scripts
MODULE 8
Math
LESSON 8.1
Math
LESSON 8.2
How to Perform Arithmetic Expansion in Bash
LESSON 8.3
How to Evaluate and Calculate Arithmetic Expressions in Bash
LESSON 8.4
Best Practices for Using Variables in Bash Arithmetic
LESSON 8.5
How to Write Conditional Expressions in Bash
LESSON 8.6
Convert Bases in Bash to Work With Octals and Hexadecimals
LESSON 8.7
How to Perform Floating Point Math With Bash bc
MODULE 9
Time
LESSON 9.1
Time
LESSON 9.2
Format Datetimes, Timestamps, and Time Zones in Bash
LESSON 9.3
How to Time How Long a Bash Command Takes to Run
LESSON 9.4
How to Kill Bash Commands With timeout
MODULE 10
Output
LESSON 10.1
Output
LESSON 10.2
How to Use the Bash Echo Command to Print Text in Terminal
LESSON 10.3
printf vs echo - Printing Formatted Text With Newlines in Bash
LESSON 10.4
Using the logger Command to Log Bash Output
MODULE 11
JSON
LESSON 11.1
JSON
LESSON 11.2
How to Use jq Command to Filter JSON in Bash
LESSON 11.3
Creating
MODULE 12
XML
LESSON 12.1
XML
LESSON 12.2
Extracting an XML Value in Bash With xml_grep
LESSON 12.3
Formatting and Transforming XML with XSLT
LESSON 12.4
How to Create XML Files in Bash With xsltproc
LESSON 12.5
Auto-Formatting
MODULE 13
Images
LESSON 13.1
Images
LESSON 13.2
How to Take Screenshots in Ubuntu Linux With Shortcuts and Bash
LESSON 13.3
Resize, Convert, and Crop Pictures With ImageMagick mogrify
LESSON 13.4
How to Create a Video From Images With ffmpeg
LESSON 13.5
How to Create Graphs From Terminal With Graphviz
LESSON 13.6
How to Remove and Edit Metadata From Photos With exif
MODULE 14
Archiving and Compression
LESSON 14.1
Archiving and Compression
LESSON 14.2
Beginner's Guide to tar Commands to Compress and Extract Files
LESSON 14.3
Plain gzip
LESSON 14.4
Zip
LESSON 14.5
Other formats
MODULE 15
SSH
LESSON 15.1
SSH
LESSON 15.2
How to Connect to an SSH Host Interactively
LESSON 15.3
How to Create and Store SSH Keys in Bash
LESSON 15.4
How to Execute Bash Scripts on Remote Server Non-Interactively
LESSON 15.5
How to Access an SSH Server Behind a Jump Server
LESSON 15.6
How to Exit SSH and Close a Hung Connection
MODULE 16
From the Terminal to Production
LESSON 16.1
From the Terminal to Production
LESSON 16.2
The Portable Shebang Line to Run Bash Scripts Anywhere
LESSON 16.3
How to Write Readable man Documentation For Your Bash Scripts
LESSON 16.4
How to Build a Fail-Fast, Safe Bash Scripts
LESSON 16.5
How to Check Shell Version From a Bash Script
LESSON 16.6
How to Parse Bash Command Line Arguments
LESSON 16.7
How to Include Files in Bash Command Line Arguments
LESSON 16.8
How to Restrict Variable and Function Scope in Bash Scripts
MODULE 17
Fail–Fast Settings
LESSON 17.1
Fail–Fast Settings
LESSON 17.2
How to Exit Bash Script on Error With errexit
LESSON 17.3
How to Prevent a Bash Script From Overwriting Files With noclobber
LESSON 17.4
Make Bash Treat Undefined Variables as Errors With nounset
LESSON 17.5
How to Set Bash pipefail to Add Exit Codes to Scripts
LESSON 17.6
How to Fail a Bash Glob if it Returns no Files With failglob
MODULE 18
Version Control
LESSON 18.1
Version Control
LESSON 18.2
How to Start Using and Configure Git in Bash Terminal
LESSON 18.3
How to Use Git in Bash Terminal to Push, Pull, and Commit Code
LESSON 18.4
Git gud
MODULE 19
Quality Assurance
LESSON 19.1
Quality Assurance
LESSON 19.2
The Beginner's Guide to Bash Linter
LESSON 19.3
How to Test Bash Scripts
MODULE 20
Signals
LESSON 20.1
An Intro to Bash Signals: SIGINT, SIGKILL, SIGQUIT, and SIGTERM
LESSON 20.2
How to Send Signals From Bash
LESSON 20.3
How to Handle Signals and Errors in Bash Scripts
MODULE 21
Autocompletion
LESSON 21.1
Autocompletion
LESSON 21.2
How to Install Bash Autocompletions
LESSON 21.3
How to Write an Autocompletion for a Bash Script
MODULE 22
Summary and Changelog
LESSON 22.1
Summary
LESSON 22.2
Changelog
Go to Next Lesson
Go to Next Lesson
LESSON 17.6
How to Fail a Bash Glob if it Returns no Files With failglob
Go Pro
Log In
How to Set Bash pipefail to Add Exit Codes to Scripts