Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How do I search for binary characters in less? [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
curmudgeon
Veteran
Veteran


Joined: 08 Aug 2003
Posts: 1744

PostPosted: Tue Jul 17, 2007 2:01 pm    Post subject: How do I search for binary characters in less? [solved] Reply with quote

Looking at a binary file in less, I want to find (say) the next occurance of the character 0xab. How do I do that? I know how to search for binary characters in vim, but vim doesn't display the file the way I want to see it like less does. Thanks.

Last edited by curmudgeon on Tue Jul 17, 2007 3:06 pm; edited 1 time in total
Back to top
View user's profile Send private message
didymos
Advocate
Advocate


Joined: 10 Oct 2005
Posts: 4798
Location: California

PostPosted: Tue Jul 17, 2007 2:24 pm    Post subject: Reply with quote

Just search for the string like you normally would: Hit forwardslash and type in 0x<whatever>. That applies to executables by the way. Less recognizes them and displays them in a special format. For something like a ROM image or other format less doesn't recognize, you still only need to search normally, only the 0x is omitted.
_________________
Thomas S. Howard
Back to top
View user's profile Send private message
curmudgeon
Veteran
Veteran


Joined: 08 Aug 2003
Posts: 1744

PostPosted: Tue Jul 17, 2007 3:06 pm    Post subject: Reply with quote

I swear I tried that (the second case - for a non-executable file), and it didn't work before, but it does work now, so apparently, I did something wrong. Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum