Skip to content

Instantly share code, notes, and snippets.

@fprieur
Created February 3, 2015 19:47
Show Gist options
  • Save fprieur/7a24580aff3fa45a6406 to your computer and use it in GitHub Desktop.
Save fprieur/7a24580aff3fa45a6406 to your computer and use it in GitHub Desktop.
vdm - bash - only show line number and string in line with grep

with grep, to show only line number and string on the line:

grep -n "[string_to_search]" [filename] |cut -f1,2 -d:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment