LinuxCommandLibrary

dash

POSIX-compliant shell optimized for speed

TLDR

Run script

$ dash [script.sh]
copy
Run command string
$ dash -c '[command]'
copy
Check syntax without executing
$ dash -n [script.sh]
copy
Debug mode (print commands)
$ dash -x [script.sh]
copy
Verbose mode (print input)
$ dash -v [script.sh]
copy
Interactive shell
$ dash -i
copy

SYNOPSIS

dash [options] [script-file [arguments]]

DESCRIPTION

dash is the Debian Almquist Shell, a POSIX-compliant /bin/sh implementation designed for efficiency and standards compliance. It is significantly faster and smaller than bash, making it ideal for running shell scripts and system initialization.
The shell prioritizes script execution speed, startup time, and minimal memory footprint over interactive features. It's approximately 4x faster than bash for script execution, which is why Debian and Ubuntu use it as the default /bin/sh.
dash is derived from NetBSD's ash (Almquist shell), which itself was created as a BSD-licensed replacement for the original Bourne shell. It implements the POSIX shell specification strictly, without bash extensions like arrays, [[ ]] conditionals, or process substitution.
The shell is primarily used for system scripts, package manager scripts, and situations where POSIX compliance and performance matter more than advanced interactive features.

PARAMETERS

-c string

Read commands from string
-s
Read commands from stdin
-i
Interactive mode
-l
Login shell
-f
Disable filename expansion (noglob)
-n
Check syntax only (noexec)
-u
Error on undefined variables (nounset)
-v
Print input lines (verbose)
-x
Print commands before execution (xtrace)
-e
Exit on error (errexit)
-I
Ignore EOF in interactive mode
--help
Show help
--version
Show version

PERFORMANCE

Approximately 4x faster than bash for script execution.

COMPATIBILITY

Strictly POSIX-compliant. Bash-specific features not supported:
- `[[ ... ]]` conditionals
- Process substitution `<()`
- Arrays
- Non-standard globbing

CAVEATS

Scripts using bash-isms will fail. Use `#!/bin/bash` for bash-specific scripts. dash is /bin/sh on Debian/Ubuntu.

SEE ALSO

bash(1), sh(1), zsh(1)

> TERMINAL_GEAR

Curated for the Linux community

Raspberry Pi 5 8GB

Raspberry Pi 5 8GB

$134.50
BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

$239.99
KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

$16.99
Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community

New Raspberry Pi 3 Model B+ Board Raspberry PI 3B+

New Raspberry Pi 3 Model B+ Board Raspberry PI 3B+

$54.00
KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

$16.99
BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

$239.99