Online Linux Terminal Logo
OnlineLinuxTerminal
Traitement de texteCLI Manual

$sed

Stream editor for filtering and transforming text using pattern substitutions.

Syntaxe de la commandePOSIX Standard
sed [OPTIONS] SCRIPT [INPUT-FILE...]
Communauté Linux2.4k En ligne

Échangez avec des utilisateurs Linux, apprenez des commandes et téléchargez des PDF.

Essayer en direct dans le bac à sable interactif

Simulation côté client sans installation avec retour instantané.

Ouvrir dans le terminal plein écran ↗
bash — terminal

Aperçu et fonctionnement

`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.

Options et drapeaux courants

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.

Exemples pratiques du monde réel

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

Replaces port 3000 with 8080 in the stream.