1
我一定要找到以下模式在文本文件中grep的:在文本文件中找到的模式
\xc2d
d\xa0
\xe7
\xc3\ufffdd
\xc3\ufffdd
\xc2\xa0
\xc3\xa7
\xa0\xa0
我開始尋找\x
事件和做
grep "\\x" *.log | more
,並沒有返回,這是查詢正確嗎?
我一定要找到以下模式在文本文件中grep的:在文本文件中找到的模式
\xc2d
d\xa0
\xe7
\xc3\ufffdd
\xc3\ufffdd
\xc2\xa0
\xc3\xa7
\xa0\xa0
我開始尋找\x
事件和做
grep "\\x" *.log | more
,並沒有返回,這是查詢正確嗎?
我想你會想用單引號而不是雙引號。
grep '\\x' *.log | more
你的殼很可能stripping that first backslash as part of the processing it does for strings in double quotes,它的grep的需求。
您的文件內容與您向我們展示的內容不一致,或者文件不以.log結尾。我在一個文件中使用了相同的查詢,並且把所有的行都帶回去了(就像我應該有的那樣)。 – 2012-07-25 19:42:15