Online Linux Terminal Logo
OnlineLinuxTerminal
Обработка текстаCLI Manual

$sed

Stream editor for filtering and transforming text using pattern substitutions.

Синтаксис командыPOSIX Standard
sed [OPTIONS] SCRIPT [INPUT-FILE...]
Сообщество Linux2.4k Онлайн

Общайтесь с пользователями Linux, учите команды и скачивайте шпаргалки.

Попробуйте в интерактивной песочнице

Клиентская симуляция без установки с мгновенным результатом.

Открыть в полноэкранном терминале ↗
bash — terminal

Обзор и принцип работы

`sed` (Stream Editor) performs basic text transformations on an input stream or file. Its most famous capability is search-and-replace using the `s/find/replace/g` syntax, allowing automated batch editing of source code and configurations without opening a visual editor.

Основные флаги и параметры команды

Flag / OptionDescription
-iEdit files in place directly instead of printing to stdout.
-e [script]Add the script to the commands to be executed.
-nSuppress automatic printing of pattern space.

Практические примеры использования

#1Substitute string patterns in text output
echo "localhost:3000" | sed "s/3000/8080/g"

Replaces port 3000 with 8080 in the stream.