1

I have to find the following patterns in a text file

\xc2d d\xa0 \xe7 \xc3\ufffdd \xc3\ufffdd \xc2\xa0 \xc3\xa7 \xa0\xa0 

I start with finding \x occurrences and do this

 grep "\\x" *.log | more 

and nothing returns, is this query correct?

1
  • Either the contents of your file is not the same as the one you showed us or the file does not end in .log. I ran the same query on a file with those exact lines in it and I got all the lines back (as I should have). Commented Jul 25, 2012 at 19:42

1 Answer 1

2

I think you'll want to use single quotes instead of double quotes.

grep '\\x' *.log | more

Your shell is likely stripping that first backslash as part of the processing it does for strings in double quotes, which grep needs.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.