sed
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
sed [2015/05/08 19:29] – created luke7858 | sed [2024/05/23 07:26] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 13: | Line 13: | ||
g represents every occurance | g represents every occurance | ||
</ | </ | ||
+ | \\ | ||
+ | \\ | ||
+ | === remove multiple characters from line === | ||
+ | Below removed [ and ] | ||
+ | <sxh bash> | ||
+ | sed ' | ||
+ | </ | ||
+ | below removes , 7 and l | ||
+ | <sxh bash> | ||
+ | sed ' | ||
+ | </ | ||
+ | \\ | ||
+ | \\ | ||
+ | === remove anything before a character === | ||
+ | <sxh bash> | ||
+ | sed ' | ||
+ | </ | ||
+ | For example, if you are trying to get the log format for apache (centos): | ||
+ | <sxh bash> | ||
+ | grep ^ErrorLog / | ||
+ | </ | ||
+ | Returns | ||
+ | <sxh bash> | ||
+ | error_log | ||
+ | </ | ||
+ | Sometimes format is error.log |
sed.1431113372.txt.gz · Last modified: 2024/05/23 07:26 (external edit)