开发者

Searching for right double angle quotes on freebsd7 unix

开发者 https://www.devze.com 2022-12-15 15:27 出处:网络
I know how to search for a string in files using grep grep -Flr --include \"*\" \'string\' files/ However how would I search for right double angle quotes ( » 开发者_Go百科) as the character will

I know how to search for a string in files using grep

grep -Flr --include "*" 'string' files/

However how would I search for right double angle quotes ( » 开发者_Go百科) as the character will not appear in the terminal.


The double angle quotes are ASCII codes 174 (<<) and 175 (>>), if you are talking about ANSI character set and not Unicode.

You can try

grep `echo "\256"` file 

256 is the octal ASCII value for <<. Note that octal value is enclosed in backquotes.

0

精彩评论

暂无评论...
验证码 换一张
取 消