All tags
sed
- Tip
sed -n '$=' access.logsed -n '$=' prints how many lines a file hasPrint the number of lines in a file, or the line numbers of matches, with sed.3 Dec 2026 - Tip
echo 'hello world' | sed 's/.*/\U&/'Sed \U and \L change the case of the text you just matchedUpper- or lowercases a match inside the replacement part of an s command in GNU sed.2 Dec 2026 - Tip
sed 's/\/mnt\/user\/appdata\/old/\/mnt\/user\/appdata\/new/' app.confUse s|old|new| in sed when your text is full of slashesSwaps the slash in a sed replacement for another character, so paths stay readable.27 Nov 2026 - Tip
sed -i.bak 's/old-host/new-host/g' config.txtsed -i.bak keeps a copy of the file you just changedEdits a file in place with sed and saves the original as a backup copy.19 Nov 2026 - Tip
printf 'key=1\nport=80\n' | sed '/^port=/a timeout=5'Sed '/pattern/a text' adds a new line after every matching lineInserts a line of text after each line that matches a pattern.2 Dec 2026 - Tip
sed -n '210,218p' /etc/nginx/nginx.confsed -n '10,20p' prints just a range of lines from a filePrints only the lines between two line numbers, without opening an editor.27 Nov 2026
Nothing matches.