You can't do that using one go of grep
. You need to use two grep
instances :
grep 'string1' file; grep -A 5 'string2' file
If you want to run the second upon success of the first one :
grep 'string1' file && grep -A 5 'string2' file
You can't do that using one go of grep
. You need to use two grep
instances :
grep 'string1' file; grep -A 5 'string2' file
If you want to run the second upon success of the first one :
grep 'string1' file && grep -A 5 'string2' file