title: How to remove all non-numeric characters from a string in Bash?
body: <p>Example:</p>
  
  <pre><code>file="123 hello"
  </code></pre>
  
  <p>How can I edit the string <code>file</code> such that it only contains the numbers and the text part is removed?</p>
  
  <p>So,</p>
  
  <pre><code>echo $file
  </code></pre>
  
  <p>should print <code>123</code> only.</p>