Linux: use a pattern for new line in grep and sed


Use a pattern for new line in grep and sed

Solution: use grep -zoP

Example:

grep -zoPRl "\/\*[a-f0-9]*\*\/\n*\@include" --include="*.php" /home

Use a pattern for new line in grep and sed

Solution: use sed -z

Example:

cat /home/victim.com/public_html/index.php |sed -z 's/\/\*[a-f0-9]*\*\/\n*\@include "[^"]*";\n*\/\*[a-f0-9]*\*\/\n*//g'

Leave a Reply