Unix Shell
Use Warp as my terminal & Fish as my shell.
Zsh & Oil seem nice too. Explain Shell is useful.
ShellCheck is great for linting scripts. How Warp works is a great read. sh is nice Go lib to parse Shell code.
rc shell from Plan 9 OS is interesting too.
fzf, Atuin, shell2http & Pipr & are great additions to the shell.
Liked this article as intro to shell.
Variables
All active variables can be seen by running env
.
$HOME
- Expands to the path of my home folder.$PS1
- Variable that represents my command prompt line.$PATH
- Special environment variable that contains the command path (list of system directories that the shell searches when trying to locate a command).
Notes
- Scripts are run in subshells, and nothing is shared "upwards". That's the difference between running a script and sourcing one. A sourced (imported) script is run in your own script's namespace.
- In shell everything is a string.
- Children never touch parent environment. It can only if it runs as part of the current process (source, function, alias).
- Pipes are used to connect one process's output with another process’s input.
/etc/paths.d
define paths to add to$PATH
globally to all users.
Links
- Effective Shell (Code) (HN)
- Explain Shell - Enter a command to see help text for each arg. (HN)
- Introduction to POSIX Shell
- Yoshua's notes
- Shell Auto-completion Systems
- Shell and Scripting (2019)
- ShellCheck - Finds bugs in your shell scripts. Code. (Zine)
- Rash - The Reckless Racket Shell. (Web)
- Eternal Terminal - Remote shell that automatically reconnects without interrupting the session.
- patat - Terminal-based presentations using Pandoc.
- What does your shell prompt look like? (2019)
- direnv - Unclutter your .profile. (Code) (Lobsters)
- mask - CLI task runner defined by a simple markdown file.
- Purs - Pure-inspired prompt in Rust.
- Sampler - Tool for shell commands execution, visualization and alerting. Configured with a simple YAML file.
- Nu Shell - Modern, GitHub-era shell written in Rust. (HN)
- Collection of pure POSIX sh alternatives to external processes
- Lobsters: What does your shell prompt look like? (2019)
- navi - Interactive cheatsheet tool for the command-line. (HN)
- Announcing Alacritty, a GPU-accelerated terminal emulator
- What Is a Shell? (2019)
- Lobsters: What shell do you use? (2019)
- “Use Dumb Shell, don’t Reinvent the Wheel” (2020) (Lobsters)
- In search for a better job scheduler - What if cron and systemd had a baby? Wouldn't it be beautiful? (HN)
- Writing Safe Shell Scripts (2019) (HN)
- Curl to shell isn’t so bad (2019) (HN)
- Partial Tour Through the UNIX Shell
- ABS - Programming language that works best when you're scripting on your terminal.
- Wez's Terminal - GPU-accelerated cross-platform terminal emulator and multiplexer written in Rust.
- Text processing in the shell (2020) (HN)
- Crush - Attempt to make a command line shell that is also a powerful modern programming language.
- Nsh - Fish/bash-like Posix shell in Rust. (HN)
- Three Comics For Understanding Unix Shell (2020)
- Oil Shell - New Unix shell. (Blog) (Idioms)
- asciinema - Web player for terminal session recordings. (Code) (4x smaller, 50x faster) (HN)
- svg-term-cli - Share terminal sessions via SVG and CSS.
- Customizing your shell (2020) (HN)
- tmate - Instant terminal sharing. (Code)
- Rich’s sh (POSIX shell) tricks
- Shell productivity tips and tricks (2020) (HN)
- Tutorial - Write a Shell in C (2015) (Code) (HN)
- DSL for shell scripting (2020) (Lobsters)
- Shell Script Compiler - Generic shell script compiler. Shc takes a script, which is specified on the command line and produces C source code.
- Shell script template suitable for most software developers
- Chafa - Command-line utility that converts all kinds of images, including animated GIFs, into sixel or ANSI/Unicode character output that can be displayed in a terminal.
- streamhut - Stream and send data, terminal to web and vice versa.
- TermBackTime - Terminal recording and playback.
- shell-functools - Functional programming tools for the shell.
- Hacking with environment variables (HN)
- CMD.XYZ - GPT3 command creator for Linux.
- Alacritty - Cross-platform, GPU-accelerated terminal emulator. (HN) (Lobsters)
- The Terminal Jockey's Toolbelt (2020) (Lobsters)
- asciicast2gif - Generate GIF animations from asciicasts (asciinema recordings).
- coin - Command interpreter for Unix, for learning how shells issue commands.
- Overmind - Process manager for Procfile-based applications and tmux.
- Tunshell - Remote shell into ephemeral environments behind NAT/firewall. (HN) (Web)
- A Better Shell (2019) (HN)
- What Shell Am I Using? (HN)
- terminal.sexy - Terminal Color Scheme Designer. (HN)
- Shell redirection example (2019)
- Kitty - Fast, featureful, GPU based terminal emulator. (Code) (HN) (HN)
- Upterm - Open-source solution for sharing terminal sessions instantly over the public internet via secure tunnels.
- libtmt - Small, simple, useful terminal emulation library.
- Syntactic Concepts in the Oil Language (Lobsters)
- smash - New kind of terminal. (Docs)
- webify - Turn shell commands into web services.
- waitfor - Shell app for delaying on conditions.
- Useful shell prompt (2020) (Lobsters)
- awk: BEGIN { (2020) (HN) (Lobsters)
- Pretty CSV viewing on the Command Line (2016) (Lobsters)
- Terminals Are Sexy - Curated list of Terminal frameworks, plugins & resources for CLI lovers. (Code)
- eDEX-UI - Fullscreen, cross-platform terminal emulator and system monitor that looks and feels like a sci-fi computer interface.
- What is a shell? A TTY? A Terminal?
- Features of a Modern Terminal Emulator (2020) (Lobsters)
- vte - Parser for implementing virtual terminal emulators in Rust.
- getoptions - Elegant option parser for shell scripts (sh, bash and all POSIX shells).
- McFly - Fly through your shell history.
- Hull - Shell where every piece of its state is stored in the filesystem.
- Sockets in Your Shell (2020) (HN)
- Shellac - Tool to make invoking a series of shell commands safer & better-looking.
- Become Shell Literate (2020) (HN) (Lobsters)
- Ask HN: How do I become a shell god? (2020)
- POSIX Shell and Utilities Quick Reference
- tab - Intuitive, config-driven terminal multiplexer designed for software & systems engineers.
- Waiting for jobs, and the concept of the shell (2020)
- Terminal Recorder - Fast terminal recorder that generates animated gif images for the web written in rust.
- Unix shell pipelines have two usage patterns (2021) (Lobsters)
- atom - Shell scripting that will knock your socks off.
- sh - Shell parser, formatter, and interpreter with bash support; includes shfmt.
- Compleat - Generate command-line completions using a simple DSL.
- The terminal, the console and the shell - what are they? (2021)
- tio - Simple TTY terminal I/O application. (Web)
- rwsh - UNIX shell based around Structural Regular Expressions and the usam experiment.
- Why Create a New Unix Shell? (2021) (HN)
- Next Generation Shell (NGS) - Modern programming language with the focus on systems engineering. (Web)
- Alternative Shells (Lobsters)
- Run Python Code in a Shell Script (2021)
- murex - Alternative shell with native support for JSON, YAML, TOML, CSV, etc. (Web) (HN)
- Atuin - Manages and synchronizes your shell history. (HN)
- pimp - Give your shell commands superpowers.
- Fig - Autocomplete for terminals on MacOS. (Web) (HN) (Issues)
- Elvish Shell - Expressive programming language and a versatile interactive shell, combined into one seamless package. (Tour)
- All the characters that work on any terminal and any operating system
- Improving shell workflows with fzf (2021) (HN)
- Shell Field Guide
- Koi language - Minimalistic language, mainly aimed at shell scripting. (Code)
- What was the point of [ “x$var” = “xval” ]? (2021) (HN)
- The TTY demystified (2008) (HN)
- Reverse Shell Generator (Code)
- Learn GNU AWK
- My Favorite One Liners (HN)
- The Once and Future Shell (2021)
- zx - JavaScript for Shell Scripting. (Lobsters) (HN) (Video) (Lobsters) (Intro to Writing Scripts With zx) (Docs) (Lobsters)
- lazycli - Turn static CLI commands into TUIs with ease.
- Quickly copy the output of the last shell command you ran (2021)
- Performance optimizations for the shell prompt (2021)
- GoTTY - Share your terminal as a web application.
- TermPair - View and control terminals from your browser with end-to-end encryption.
- Unix Shell Programming: The Next 50 Years (2021) (HN) (HN) (Review) (HN)
- Hilbish - Interactive Unix-like shell written in Go, with the config and other code written in Lua.
- Typed Pipes in Every Shell (HN)
- 4 Useful fzf Tricks for Your Terminal (2021)
- How to replace a string with sed in current and recursive subdirectories
- Gufo - Modern shell language.
- Warp - Fast, Rust-based terminal. (HN) (Issues) (HN)
- How Warp Works (2021) (Lobsters)
- TStream - Live streaming from your terminal. (Web)
- ; echo "Shell Injection" (2021) (Lobsters) (HN)
- Unix Shell: History and Trivia (2021)
- Processing Semi-Structured Data in the Unix Shell (2021)
- An Opinionated Guide to xargs (2021) (HN)
- Illustrated Redirection Tutorial (HN)
- Running Awk in parallel to process 256M records (2020)
- PaSh: Light-touch Data-Parallel Shell Processing (2021)
- resholve - Replaces references to a bash/shell script's external dependencies (commands and sourced scripts) with absolute paths.
- Fun with Redirection (2021)
- Dune - Shell by the beach. (HN)
- Understanding AWK (2021) (HN) (Lobsters)
- Cloudshell - Xterm.js frontend that connects to a Go backend to provide a shell to the host system. Basically, access your shell from a browser.
- The Return of the Unix Shell (2021)
- Command line text processing with GNU Coreutils
- Showing GUIs from Shell Scripts (2021) (HN)
- overdub - Create new commands from your shell history or terminal.
- async - Tool to parallelize shell commands.
- Seashells - Pipe output from command-line programs to the web in real-time. (HN) (Go Client) (Server Code)
- Run - Easily manage and invoke small scripts and wrappers.
- Stephen Bourne: Early days of Unix and design of sh (2015)
- Anatomy of a Terminal Emulator (2021) (HN)
- GNU Utility: envsubst
- shell.how - Write down a command-line to see how it works. (Code)
- Useful sed scripts & patterns (HN)
- nhi - Capture every information about each executed command. (HN)
- Demo Magic - Handy shell script that enables you to write repeatable demos in a bash environment.
- Tiny Shell (tish) - Written in Go.
- terminal-to-html - Converts arbitrary shell output (with ANSI) into beautifully rendered HTML. (Web)
- xonsh - Python-powered, cross-platform, Unix-gazing shell language and command prompt. (Web)
- Common shell script mistakes (2008) (HN)
- makesure - Simple task/command runner with declarative goals and dependencies.
- vsh - Unix shell written and implemented in rust.
- You shouldn't parse the output of ls(1) (HN)
- Oil Retrospective: Software Architecture
- Passing runtime data to AWK (2020)
- The Way - Code snippets manager for your terminal.
- Practical Shell Patterns I Actually Use (2022) (HN)
- The missing comprehensive package manager for Shell (2022) (Lobsters)
- rat - Compose shell commands to build terminal applications.
- chmod-cli - Effortlessly generate chmod commands.
- Morbig: A Static parser for POSIX shell (2020) (Lobsters)
- mrsh - Minimal POSIX shell.
- Anatomy of a Terminal Emulator (2021) (Code)
- How to Split a String in POSIX Shell (2021)
- Blink Shell - Professional, desktop grade terminal for iOS. With Mosh & SSH clients for iOS, lightning fast and fully customizable. (Docs)
- Julia Evans's Shell Examples
- termsvg - CLI tool to record, share and export your terminal as a animated SVG image.
- Bearings - Fast, clean, customizable shell prompt for zsh, bash, fish, and more.
- Oh My Posh - Prompt theme engine for any shell. (Web)
- Please stop writing shell scripts (2022) (Lobsters)
- GitHub Scripts To Rule Them All - Boilerplate scripts describing the normalized script pattern that GitHub uses in its projects.
- Cotowali - Statically typed scripting language that transpile into POSIX sh. (HN)
- Morbig - Static Parser for POSIX Shell. (HN)
- Awesome Terminals
- Cli2Cloud - Pipe your terminal output to the cloud. (Web)
- What are the most useful aliases in your bashrc or zshrc (2022)
- sd - Cozy nest for your scripts. (Article) (HN)
- svg-term - Share terminal sessions via SVG and CSS.
- Redo - Command line application to easily create reusable functions in your own shell. (HN)
- The Day of a new Command-Line Interface: Shell (2022)
- Crab - Simple unix toolkit for working with local development environments.
- Nice scripting languages
- Pipr - Tool to interactively write shell pipelines.
- Terminal Colors - Color standards for terminal emulators.
- asciinema virtual terminal
- asciinema-rs - Asciinema client written in Rust.
- Build Your Own Shell
- ACME Shell script: acme.sh - Pure Unix shell script implementing ACME client protocol.
- The Front-End Developer's Guide to the Terminal (2022) (HN)
- An Introduction to the Unix Shell
- Hush - Unix shell scripting language inspired by Lua. (Docs) (Lobsters) (HN)
- webhookd - Simple webhook server launching shell scripts.
- Extraterm - Swiss army chainsaw of terminal emulators.
- Ask HN: Why are there so many companies trying to reinvent the terminal (badly)? (2022)
- gifcast - Converts an asciinema cast to an animated GIF.
- RESH: Rich Enhanced Shell History - Contextual shell history for Zsh and Bash. (HN)
- Everything you ever wanted to know about terminals (but were afraid to ask) (HN)
- GameShell - Game to learn (or teach) how to use standard commands in a Unix shell. (HN)
- Shell Patterns for Easy Automated Code Migrations (HN)
- Shell scripts should be written to be clear first
- Writing Unit-Tests and Mocks for UNIX Shells (2022)
- asciinema-edit - Auxiliary tools for dealing with ASCIINEMA casts.
- PaSh - Light-touch Data-Parallel Shell Processing. (Web)
- Start all of your commands with a comma
- Practically Correct, Just-in-Time Shell Script Parallelization
- A lifehack for your shell (2022) (Lobsters)
- What happens when you press a key in your terminal? (2022) (HN) (Lobsters)
- z-run - Scripting library lightweight Go-based tool. (Lobsters)
- shellfirm - Intercept any risky patterns (default or defined by you) and prompt you a small challenge for double verification.
- What is TTY? (2022)
- agg - asciinema GIF generator.
- YavaScript - Bash-like script runner which is distributed as a single statically-linked binary. Scripts are written in JavaScript.
- Lunatic.chat - Telnet chat server written in Rust, running on Lunatic.
- Transcending Posix: The End of an Era? (2022) (HN)
- Es - Shell with higher-order functions.
- Ask HN: Is it still possible to live in a terminal? (2022)
- Whipping up a new Shell – Lash#Cat9 (2022) (Lobsters)
- Cat9 - command-line shell written in Lua. (HN)
- Shell Script Best Practices, from a decade of scripting things (2022) (HN) (Lobsters)
- Keyboard Shortcuts every Command Line Hacker should know about GNU Readline (HN)
- Toy Shell
- hiSHtory - Your shell history in context, synced, and queryable. (HN)
- Building a simple shell in C (2022)
- Codex CLI - Natural Language Command Line Interface.
- Why is the terminal input so weird? | Warp (2022) (HN)
- We Built Syntax Highlighting for the Terminal Input Editor (2022) (HN)
- tesh - TEstable SHell sessions in Markdown. (Lobsters)
- A pragmatic approach to shell completion (2022)
- Drag and Drop from Terminal (2022) (HN)
- shcopy - Shell Copy. Simple utility that copies text to the clipboard from anywhere using ANSI OSC52 sequence.
- patsh - Command-line tool for patching shell scripts inspired by resholve.
- GNU/Linux shell related internals
- How to share terminal demos as razor-sharp animated SVG (2022)
- A year of building for the terminal (2022) (HN)
- teetty - Wrapper binary to execute a command in a pty while providing remote control facilities.
- Shmux - Run all your scripts from one file. (HN)
- A Guide to the Terminal, Console, and Shell (2022) (HN)
- Clipboard - Cut, copy, and paste anything, anywhere, all from the terminal. (HN)
- LLM.sh - Copilot for your command line. Just type llm XYZ and it will generate/run a script for you that does XYZ.
- askai - CLI integration with OpenAI's GPT3, enabling you to ask questions and receive the answers straight in your terminal.
- chim - Cross-platform binary shims with optional remote fetching. (Intro)
- YeAST - Extension of the bourne shell shebangsyntax.
- ShellCheck Python - Python wrapper to provide a pip-installable shellcheck binary.
- Unix shell script tactics - best practices style guide
- What happens when you open a terminal and enter ‘ls’ (2023) (HN)
- cosh - Concatenative command-line shell.
- zig-embshell - Small embeddable command line shell in zig.
- Shells are Two Things (Lobsters)
- Ask HN: Are alternative (oil, nu, etc.) shells usable as daily drivers? (2023)
- Shellclear - Secure shell history commands by finding sensitive data.
- Write Posix Shell (2023) (HN) (Lobsters)
- WezTerm - GPU-accelerated cross-platform terminal emulator written in Rust. (HN)
- ttyd - Share your terminal over the web.
- Rio - WGPU based terminal - built with Rust and Tokio.
- So you've installed
fzf
– now what? (HN) - Comprehensive Keyboard Handling in Terminals (HN)
- engshell - English-language shell powered by LLMs.
- AI Shell - CLI that converts natural language to shell commands.
- Getting the ^D (2023)
- Terminals and Shells 1: Fundamentals
- Fig Discord
- Termonad - Terminal emulator configurable in Haskell.
- The data structure behind terminals (2023)
- ChatGPT autocompletion with atuin - Use GPT to complete shell command line using atuin shell history database and terminal screen content as prompt.
- Mods - AI on the command line.
- Yai - Your AI powered terminal assistant.
- aider - GPT-4 powered coding in your terminal.
- Clive - Automates terminal operations.
- haxx - Easily create and run scripts using JS.
- IntelliShell - Like IntelliSense, but for shells.
- tesh - End-to-end tests for shell commands.
- Historian - Command-line utility for managing shell history in a SQLite database.
- complgen - Generate shell completions based on a BNF-like grammar.
- Ghostty Devlog 001 (2023)
- ShellGPT - Upgrade your terminal with GPT-4.
- humanscript - Script interpreter that infers the meaning behind commands written in natural language using large language models.
- tty-share - Share your Linux or macOS terminal over the internet.
- The Terminal (2014)
- Ask HN: Share a shell script you like (2023)
- autocast - Automate terminal demos.
- carapace-bin - Argument completion for multiple CLI commands.
- Ghostty Devlog 003 (2023)
- Pueue - Manage your shell commands.