3 ms·
Command line made easy: five simple recipes for grep
- pkulak 18y agogrep -c "^<segph\(ault\|one\)>" channel.log Anyone know why all the syntax is escaped there?
- RiderOfGiraffes 18y agoYes. If not escaped grep will consider the syntax as literals and search for them. Being escaped makes grep treat them as syntactic elements of the regular expression, not characters to match. For example, "te(s|x)t" will match neither "test" nor "text", but will match anything that has "te(s|x)t" in it. On the other hand, "te\(s\|x\)t" will match any line with "test" or "text" in it.