Show practical sed usage.
IntermediateConceptPackages, Shell & Text Tools
Answer
sed -n '100,120p' big.log # print a line range
sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config
sed -i.bak 's/old/new/g' app.conf # in-place with backup
sed '/^\s*#/d; /^\s*$/d' nginx.conf # drop comments and blanks
sed -i '/^server 10.0.0.5/d' upstream.conf # delete matching lines
GNU sed -i takes an optional suffix; BSD/macOS sed needs -i ''.
More on Packages, Shell & Text Tools
Compare apt and dnf package management.BeginnerWhat is the difference between `apt upgrade` and `apt full-upgrade`?IntermediateHow do you find which package provides a file or command?BeginnerHow do you pin or hold a package version?IntermediateHow are repositories and their GPG keys configured?AdvancedWhat is the difference between a login shell and an interactive non-login shell?Intermediate