sed

Edit text in a scriptable manner. See also: awk, ed. More information: <https://manned.org/man/sed.1posix>.

Install

All systems
curl cmd.cat/sed.sh
Debian Debian
apt-get install sed
Ubuntu
apt-get install sed
Alpine
apk add sed
Arch Arch Linux
pacman -S sed
image/svg+xml Kali Linux
apt-get install sed
CentOS
yum install sed
Fedora
dnf install sed
Windows (WSL2)
sudo apt-get update sudo apt-get install sed
Raspbian
apt-get install sed
Docker
docker run cmd.cat/sed sed powered by Commando

Edit text in a scriptable manner. See also: awk, ed. More information: <https://manned.org/man/sed.1posix>.

  • Replace all `apple` (basic regex) occurrences with `mango` (basic regex) in all input lines and print the result to `stdout`:
    command | sed 's/apple/mango/g'
  • Execute a specific script [f]ile and print the result to `stdout`:
    command | sed -f path/to/script.sed
  • Print just a first line to `stdout`:
    command | sed -n '1p'

© tl;dr; authors and contributors