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
-
apt-get install sed - Ubuntu
-
apt-get install sed -
Alpine
-
apk add sed - Arch Linux
-
pacman -S sed - Kali Linux
-
apt-get install sed - CentOS
-
yum install sed - Fedora
-
dnf install sed - Windows (WSL2)
-
sudo apt-get updatesudo apt-get install sed - Raspbian
-
apt-get install sed - Docker
-
docker run cmd.cat/sed sedpowered 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