linux - Grep capping size of results lines, for multiple grep phrases? -


i grepping terms this:

grep 'term1\|term2\|term3\|term4' 

and want say, lines found, cap results 100 characters. found examples how when searching 1 term, none accommodating or-ing of search terms.

try gnu grep:

grep -e 'term1|term2|term3|term4' file | grep -oe '^.{100}' 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -