# To replace all occurrences of "day" with "night" and write to stdout:
sed 's/day/night/g' <file>
# To replace all occurrences of "day" with "night" within <file>:
sed -i 's/day/night/g' <file>
# To replace all occurrences of "day" with "night" on stdin:
echo 'It is daytime' | sed 's/day/night/g'
# To remove leading spaces:
sed -i -r 's/^\s+//g' <file>
# To remove empty lines and print results to stdout:
sed '/^$/d' <file>
# To replace newlines in multiple lines:
sed ':a;N;$!ba;s/\n//g' <file>
# To insert a line before a matching pattern:
sed '/Once upon a time/i\Chapter 1'
# To add a line after a matching pattern:
sed '/happily ever after/a\The end.'
Monday, 26 May 2025
sed
TermRecord
TermRecord is a simple terminal session recorder with easy-to-share self-contained HTML output! TermRecord -o /tmp/session.html
-
7z : Compression utility aa : a simple utility to help create backups ab : Apache HTTP server benchmarking tool aespipe : AES encrypti...
-
grub-mkconfig - generate a GRUB configuration file grub-mkconfig -o /boot/grub/grub.cfg
-
# To sort directories/files by size: du -sk *| sort -rn # To show cumulative human-readable size: du -sh # To show cumulative human-readabl...