With Radare2, I love the iI command.

I want to limit the output with grep or radare's own grep syntax.

How do I run a iI | grep -E 'bits | pic | stripped' against my binary?

[0x100001200]> iI
arch     x86
binsz    38688
bintype  mach0
bits     64

My intention is to run this command inside a python script using r2pipe.

1 Answer 1


Radare's grep is done by using the ~ character.

|Usage: [command]~[modifier][word,word][endmodifier][[column]][:line]

So to have the output you want just run:


[0x100001200]> iI~bits,pic,stripped
bits     64
pic      true
stripped true

The same command you should run in your script. There's a lot of more that this grep can do. To get the help of it just run the ~?

  • Thanks. Just what I was looking for. Next I will try and work out why the json flag + grep instruction doesn't work with: iIj~bits,pic,stripped. But I can do that solo. Thanks again. Commented Jul 25, 2018 at 7:17
  • 1
    json supports a limited grep in a form: iIj~{bits} but you would have to grep for the three things separately. Commented Jul 25, 2018 at 14:59
  • That actually gives me a better answer. I can now use iIj~{stripped} as it return the value (true / false) instead of the Key Value Pair you get with iI~stripped (stripped true) Commented Jul 26, 2018 at 6:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.