The Shell#


Table of Contents#


Sections#


Intro#

cat /etc/shells
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

/bin/bash
/bin/csh
/bin/dash
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
/usr/local/bin/pwsh

All shells have startup files containing commands which are executed as soon as the shell starts.

The shell is there to take a list of commands and run them; it doesn’t care whether the commands are in a file or typed at the terminal. When you type a command and wait for it to run before typing another, the shell is interactive. When the shell reads commands from a file, the shell is non-interactive. A shell is interactive if it has a prompt. A list of commands in a file is called a script (as if the shell were acting in a play when it reads from it). The interactive shell waits in the background for a non-interactive copy to read a script.

Builtins and functions run as a part of the shell itself and are therefore more efficient than things like external commands (that don’t run in the shell and which can’t affect its parameters, functions, aliases, etc.).


Resources#

Shells and Terminals

  • [ h ][ g ][ w ] Alacritty

  • [ h ][ g ][ w ] Bash (Bourne-Again Shell)

  • [ h ][ g ][ w ] Bourne Shell (sh)

  • [ h ][ g ][ w ] Cmder

  • [ h ][ g ][ w ] C Shell (csh)

  • [ h ][ g ][ w ] Elvish

  • [ h ][ g ][ w ] Fig

  • [ h ][ g ][ w ] Fish

  • [ h ][ g ][ w ] Fluent

  • [ h ][ g ][ w ] Git for Windows

  • [ h ][ g ][ w ] Hyper

  • [ h ][ g ][ w ] iTerm2

  • [ h ][ g ][ w ] Kitty

  • [ h ][ g ][ w ] Korn Shell (ksh)

  • [ h ][ g ][ w ] Nerd Fonts

  • [ h ][ g ][ w ] Nushell

  • [ h ][ g ][ w ] Oh My Posh

  • [ h ][ g ][ w ] Powerlevel10k

  • [ h ][ g ][ w ] PowerShell

  • [ h ][ g ][ w ] PuTTY

  • [ h ][ g ][ w ] Starship

  • [ h ][ g ][ w ] Tabby

  • [ h ][ g ][ w ] T C Shell (tcsh)

  • [ h ][ g ][ w ] Terminal.app

  • [ h ][ g ][ w ] Terminator

  • [ h ][ g ][ w ] Tilix

  • [ h ][ g ][ w ] Warp

  • [ h ][ g ][ w ] Windows Command Prompt

  • [ h ][ g ][ w ] Windows Terminal

  • [ h ][ g ][ w ] Z Shell (zsh)

Online

  • [ h ] explainshell.com

  • [ h ] Linux Survival

  • [ h ] Google’s Shell Style Guide

  • [ h ] Command Line Environment (MIT’s Missing Semester)

  • [ h ] The Shell (MIT’s Missing Semester)

  • [ h ] Shell Tools and Scripting (MIT’s Missing Semester)

YouTube

  • [ y ] 08-02-2017. CrashCourse. “Keyboards & Command Line Interfaces: Crash Course Computer Science”.

  • [ y ] 11-09-2022. freeCodeCamp. “Command Line Hacking – Over The Wire Bandit Walkthrough (CTF Wargame)”.

  • [ y ] 11-03-2021. freeCodeCamp. “The 50 Most Popular Linux & Terminal Commands - Full Course for Beginners”.

  • [ y ] 07-25-2018. freeCodeCamp. “Command Line Crash Course”.

  • [ y ] 08-08-2019. Geek’s Lesson. “Linux Command Line Full course: Beginners to Experts. Bash Command Line Tutorials”.

  • [ y ] 03-15-2022. Learn Linux TV. “Top 5 Terminal Emulators”.

More

YouTube#

more

  • [ y ] 12-31-2023. Bartek Spitza. “Solving the Dotfiles Problem (And Learning Bash)”.


Texts#

  • Barrett, Daniel J. (2012). Macintosh Terminal Pocket Guide: Take Command of Your Mac. O’Reilly.

  • Janssens, Jeroen. (2021). Data Science at the Command Line: Obtain, Scrub, Explore, and Model Data with Unix Power Tools. 2nd Ed. O’Reilly.

  • [ g ] Powers, Shelley et al. (2002). Unix Power Tools, 3rd Ed. O’Reilly.

  • [ g ] Robbins, Arnold & Nelson H. F. Beebe. (2005). Classic Shell Scripting. O’Reilly.

  • Taylor, Dave & Brandon Perry. (2016). Wicked Cool Shell Scripts: 101 Scripts for Linux, OS X, and Unix Systems. 2nd Ed. No Starch Press.


Terms#

  • [ w ] Autocompletion

  • [ w ] Command Line

  • [ w ] Command Line Interface (CLI)

  • [ w ] Glob

  • [ w ] Globbing

  • [ w ] Interpreter Directive

  • [ w ] Pattern Calculus

  • [ w ] Pattern Matching

  • [ w ] POSIX Shell

  • [ w ] Shebang

  • [ w ] Shell

  • [ w ] Shell Builtin

  • [ w ] Shells

  • [ w ] Snippet

  • [ w ] Terminal Emulator

  • [ w ] Terminal.app

  • [ w ] Wildcard Character

  • [ w ] Wildcard Matching

  • [ w ] Windows Command Prompt

  • [ w ] Windows Console

  • [ w ] Windows Terminal