Here’s the table of contents:

  1. Look within .ipynb files

Look within .ipynb files

Find source code snippets within jupyter notebook files by finding strings

grep -r -li --include \*.ipynb "annotation"

Exclude .ipynb_checkpoints

grep --include='*.ipynb' --exclude-dir='.ipynb_checkpoints' "annotation"

Grep on results

grep --include='*.ipynb' --exclude-dir='.ipynb_checkpoints' "annotation" | grep "train"

Grep on results and sort by date

find . -iname '*.ipynb*' -exec grep -rlH "savemat" {} \; | grep -v ".ipynb_checkpoints" | xargs ls -lt