$sed
Stream editor for filtering and transforming text using pattern substitutions.
sed [OPTIONS] SCRIPT [INPUT-FILE...]Essayer en direct dans le bac à sable interactif
Simulation côté client sans installation avec retour instantané.
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 / Option | Description |
|---|---|
| -i | Edit files in place directly instead of printing to stdout. |
| -e [script] | Add the script to the commands to be executed. |
| -n | Suppress automatic printing of pattern space. |
Exemples pratiques du monde réel
echo "localhost:3000" | sed "s/3000/8080/g"Replaces port 3000 with 8080 in the stream.
Commandes Linux associées
Rechercher des motifs de chaînes ou des expressions régulières dans des fichiers texte.
Output the first part (top lines) of text files.
Output the last part (bottom lines) of files or stream real-time logs.
Print newline, word, and byte counts for files.
Print text strings or write data to files using shell redirection.
Pattern scanning and column text processing language.