User Tools

Site Tools


sed

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
sed [2015/05/08 19:52] luke7858sed [2024/05/23 07:26] (current) – external edit 127.0.0.1
Line 24: Line 24:
 sed 's/[,7l]//g' sed 's/[,7l]//g'
 </sxh> </sxh>
 +\\
 +\\
 +=== remove anything before a character ===
 +<sxh bash>
 +sed 's/.*[/]//'
 +</sxh>
 +For example, if you are trying to get the log format for apache (centos):
 +<sxh bash>
 +grep ^ErrorLog /etc/httpd/conf/httpd.conf | awk '{print $2}' | sed 's/.*[/]//'
 +</sxh>
 +Returns
 +<sxh bash>
 +error_log
 +</sxh>
 +Sometimes format is error.log
sed.1431114778.txt.gz · Last modified: 2024/05/23 07:26 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki