title: How can I force grep to only return files and ignore directories?
body: <p>I'm trying to use grep to automatically locate the bibtex program in the user's bin folder.</p>
  
  <p>The problem is, it frequently returns a directory with the name bibtex, which means that the script fails to automatically run the command.</p>
  
  <p>How can I force grep (or indeed the locate command) to automatically ignore directories?</p>
  
  <p>EDIT: The current command is: <code>locate bibtex | grep "/bibtex$" -d skip | head -n1</code></p>