Building ‘apropos’ command for radare2
Radare2 is a great tool for reverse engineering. But if you are a new user, it is a bit frustrated to get familiar with radare2 commands. There are hundred of commands available and they are organized in a sequence of abbreviations. For example, command af will be interpreted as: a[nalyze] f[unction].
Some frequently used commands can be listed:
a[nalysis]p[rint]i[nfo]d[ebug]P[roject](capital P, just to illustrate conflict happens :))
So you have to remember few keywords and its combination to form a command. For example, the command pd is created by p (print) and d (disassemble), but dp is created by d (debug) and p (process). Magic? Unlike gdb/lldb, there is no human-readable command (like disassemble) in radare2 and even no built-in apropos command to lookup for interested keywords. Though you can easily get radare2 manual with ?, walking through all commands will not be easy.
As a normal user, I can only remember a dozen of commands and I rely on apropos to search for less frequently used ones. To make radare2 learning journey more comfortable, I wrote a quick and dirty script as a standalone, custom r2apropos command by:
- Extracting all help text from
libr/core/*.c - Putting it in a standalone python script to lookup for keywords
Output of the r2apropos command will look like:

You can make an alias and put it in ~/.radare2rc for permanent use:
#~/.radare2rc
$help=!/path/to/r2apropos.py
$h=$help # make it short
Next step? May be adding appropriate keywords to radare2 manual. Hope this help and enjoy r2ing!
