TinySh a tiny Bourne shell
AlphaNew software. Things will break, and features are missing.

Version 0.1.0.1888 · Free · Mac · Windows · Linux · FreeBSD · Plan 9

A POSIX shell, small. On every computer you have. Free.

TinySh is a Bourne shell in one small program, with no libraries to install. It runs the POSIX shell language on a Mac, in the Windows console, on FreeBSD and on Plan 9, with line editing, history and job control.

No account, no advertising.

TinySh in a terminal: ls, grep piped to sort, a for loop with wc, and a variable

F1 · Language

The shell language of POSIX.1-2024.

TinySh follows the Shell Command Language: the same scripts, the same answers.

Quoting and expansion

Quoting, including $'...', every ${...} form, $(...), backquotes, $((...)), field splitting and pathname expansion.

Control

if, while, until, for, case, functions, aliases, &&, || and &.

Redirection

Here-documents, redirections and pipelines.

Checked against dash

Each language case is run through dash (and bash in POSIX mode where dash lacks a feature). TinySh must give the same output, error messages and exit status.

F2 · Prompt

A prompt you can work at.

Line editing, history that is kept between sessions, and Tab completion of commands and file names.

  • Line editing. The arrows, Home and End, and Ctrl-A, E, B, F, U, K, W, L and D.
  • Job control. Ctrl-Z stops a program. jobs, fg and bg bring it back. Windows and Plan 9 have no stop signal, so they have no Ctrl-Z.
  • Ctrl-C. It stops the running program or built-in. The shell stays.
  • vi built in. vi is TinyVi, and its :! and :sh run TinySh.

F3 · Tools

Built-in commands that work anywhere.

The utilities are inside the shell, so they work where there are no programs to run.

Utilities

ls cat cp mv rm mkdir rmdir touch grep sort wc head tail find basename dirname. Their output follows GNU coreutils 9.1 and GNU grep 3.8. help NAME lists the options of each.

Shell built-ins

echo printf test [ cd pwd read wait command type alias unalias umask help, and the special built-ins.

Your own programs

command -p NAME runs the system's own program of that name.

A library too

TinySh is a Go library. A program gives it files, processes and a screen, so it runs on any file system, in a web page and inside TreeMendous.

F4 · Everywhere

Mac, Windows, Linux, FreeBSD and Plan 9.

One program, no libraries to install.

Unix

Any terminal, over ssh too.

Windows

Paths are as in MSYS: /c/Users is C:\Users. Programs get Windows paths back.

Plan 9

Built for 9front and Plan 9 on x64, 386 and ARM. The console edits the line itself. The tests also run on a real 9front.

F5 · Download

Download TinySh 0.1.0.1888

Free, on every system: the licence. Choose the file for your computer. Each holds the program, with the licence and the third-party notices.

TinySh 0.1.0.1888 downloads by system
SystemYou needDownload
macOSmacOS 13 Ventura or later, on Apple Silicon or Intel
WindowsWindows 10 or later, or Windows Server 2016 or later
LinuxLinux kernel 3.2 or later. No libraries needed. ARM64 for a Raspberry Pi 3, 4 or 5 with a 64-bit OS
FreeBSDFreeBSD 14 or later
Plan 99front or Plan 9 from Bell Labs
How to install it

Mac, Linux and FreeBSD: unpack it, then put the program where your shell finds it:

tar -xzf tinysh-*.tar.gz        # on a Mac: unzip tinysh-*.zip
sudo install -m 755 tinysh-*/tinysh /usr/local/bin/
tinysh

Windows: unzip it, and put tinysh.exe in a folder on your PATH. Run it in Windows Terminal or a console window.

Plan 9: unpack it with tar xzf, and copy tinysh to $home/bin/$cputype/.

Run it with tinysh. To use it for a script, start the script with #!/usr/local/bin/tinysh.

The Mac program is not notarised by Apple yet. If macOS refuses to run it, open System Settings, go to Privacy & Security, and click Open Anyway, or run xattr -d com.apple.quarantine tinysh.