It is not whether
sh supports searching through history and persistent history. It is whether the editing library that it uses does. The editing library is
libedit. Indeed it does support searching through history. It does not support persistent history.
There is no key mapped to the next/previous search history actions by default. But you can map one.
bind ^R ed-search-prev-history
This mapping usually goes in
$HOME/.editrc. You can make it general or specific to
Tip: You type the pattern to search for before pressing the
ed-search-prev-history key in
libedit. Not after.
- Luke Mewburn (2014). editrc. §5. FreeBSD Manual.
- Luke Mewburn (2014). editline. §3. FreeBSD Manual.