Let’s see how we can get all documents that contain the word pandas
somewhere in a directory under the current directory. We can use the grep
command as follows:
grep -r pandas *
Now, if we want to search for a word, let’s say “pandas” within a particular file (“myscript.py“) we can run the command:
$ grep pandas myscript.py
If we want to search for any words but “pandas” we can run:
$ grep -v pandas myscript.py