Skip to content

My notepad

Chris' IT notes…

  • Home
  • Here are my notes…

sed – comment out lines matching with

sed -e '/MatchThisString/ s/^/#/' -i file

This will add a # in front of all the lines that are matching the string “MatchThisString“

This entry was posted in Linux, Scripting and tagged automation, grep, match, script, sed on January 27, 2017 by thtieig.

Post navigation

← PHPMyAdmin on Centos/Ubuntu Linux ACL examples →

My notes… organised a bit

  • Cloud (34)
  • Containers (3)
  • Linux (188)
  • Mac (22)
  • Networking (17)
  • Scripting (54)
  • Virtualisation (11)
  • Windows (7)

Tags

  • apache
  • api
  • automation
  • backup
  • bash
  • basic
  • centos
  • centos7
  • command line
  • convert
  • debian
  • innodb
  • lighttpd
  • linux
  • lvm
  • mac
  • manual
  • monitoring
  • mount
  • mysql
  • notes
  • php
  • php-fpm
  • rackspace
  • raspberry pi
  • redhat
  • redirect
  • rsync
  • script
  • server
  • shortcut
  • ssh
  • ssl
  • test
  • troubleshooting
  • tunnel
  • ubuntu
  • ubuntu 16.04
  • varnish
  • vim
  • vm
  • VMware
  • windows
  • wordpress
  • wsl
Proudly powered by WordPress