Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

grep not working

Erro with unix query

grep -C20 'contactNumber before is------>'  *

above grep command gives below error message
grep: diagnostic_images: Is a directory
grep: jmsservers: Is a directory

what it means?

please advise
ASKER CERTIFIED SOLUTION
Avatar of Kent W
Kent W
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

ASKER

if i want to search on log files only  like
file1.log009
file2.log008
etc
can i use below command?
grep 'contactNumber before is------>' *.log*
can i use below command?

yes since you are specifying a certain file name pattern
however, since you used the wildcard before and had nothing, as mentioned, use -r to be recursive through subdirctories
else, as-is, that command will return nothing if there are no *.log* files in that current folder
Avatar of noci
noci

yes the would be the right command.
Hi,
Please use -R parameter while grep , this may help  you to solve.