How can I extract the text portion of a binary file in Linux/Bash?
<p>I have a binary file. If I open it with <a href="https://en.wikipedia.org/wiki/Vi" rel="nofollow noreferrer">vi</a>, it shows sequences of human-readable text and binary characters. What is the best way to extract the human-readable portion only using Bash?</p>
<p>I was thinking, maybe we can do this over a <a href="https://en.wikipedia.org/wiki/Grep" rel="nofollow noreferrer">grep</a> or <a href="https://en.wikipedia.org/wiki/Sed" rel="nofollow noreferrer">sed</a> pattern?</p>
<pre><code>cat file1.bin | grep '????'  &gt; newfile.txt
</code></pre>