Let's say I have a text file with billions of text lines sorted alphabetically, like
Bar=10
Foo=6
Naz=42
How can I search for the line starting with Foo in the most optimal way (the file contains billions of variables like this), knowing lines are sorted alphabetically and that the line I want to find must start (or "contain" if it's easier to search for) a specific text?
Edit:
This question can be considered as duplicate of https://askubuntu.com/q/423886/10473
Answer is to use look which is fast enough for such research