Skip to content

Instantly share code, notes, and snippets.

@mazzma12
Last active May 21, 2021 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mazzma12/b8a988d0e621af678fcadd655f1d13a2 to your computer and use it in GitHub Desktop.
Save mazzma12/b8a988d0e621af678fcadd655f1d13a2 to your computer and use it in GitHub Desktop.
Find and grep occurences in file
#!/usr/bin/env bash
# Find THE notebook you have lost
expr=$1 # The content you are looking for : "*myCode*"
files=${2:-*.ipynb} # File patterns
find . -type f -name "$files" -exec grep -E "$expr" --with-filename {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment