Tag Info

Hot answers tagged

1

If you would like to exclude .git directories: grep --exclude-dir=".git" -r "word" . This works on GNU grep, not on other versions, but since you seem to be using Linux, this should be fine.


1

That happens because one of the filenames contains a quote and is passed to xargs as-is. That means xargs is run like xargs grep 'addresses' > /tmp/addr some file'name — and there is an unterminated ' here. The actual problem is that you're using find | xargs. That's something you really don't want to do, even if it looks tempting. There are a few ...


1

You can do the same using grep with the -o (--only-matching) option: cat teste | grep -o "80\/open\/tcp\/[^,]*"


1

You can do: grep -P '^.{n}$' filename Where n is the length you want, and filename is the target file


1

There are comments and timestamps that appear above each SQL command. When you run the grep, use the -A, -B, or -C option. What that does is the following -A shows you a number of lines after the pattern is found -B shows you a number of lines before the pattern is found -C shows you a number of lines before and after the pattern is found For example, ...


1

With Solaris 11 use the already installed GNU grep: /usr/gnu/bin/grep



Only top voted, non community-wiki answers of a minimum length are eligible