Delete lines matching pattern

Remove all comment lines starting with #

sed -i '/^#/d' config.conf

tool
linux133 commands
tags
linux

More linux commands

  • sed -n '/START/,/END/p' file.txt

    Print block of text between START and END markers

  • sort file.txt | uniq -c | sort -rn

    Count occurrences of each unique line

  • who -H && w

    Active user sessions and what they are running

  • last -n 20 | head -25

    Last 20 login records with IP and duration

  • journalctl -u ssh --since '24h ago' | grep 'Failed password' | awk '{print $(NF-3)}' | sort | uniq -c | sort -rn | head -10

    Top source IPs of failed SSH logins in last 24h

all 133 linux commands