Delete lines matching pattern linux
Remove all comment lines starting with #
sed -i '/^#/d' config.conf
more linux
all 133 commands →
Multi-line sed replacement
sed -n '/START/,/END/p' file.txt
Unique sorted values
sort file.txt | uniq -c | sort -rn
Show users logged in
who -H && w
Last logins
last -n 20 | head -25
Failed login attempts
journalctl -u ssh --since '24h ago' | grep 'Failed password' | awk '{print $(NF-3)}' | sort | uniq -c | sort -rn | head -10