When you want to find a word in a string, use find()
e.g.
import sys
arg1 = sys.argv[1] # passing the first argumentif arg1.find("off") == -1: # if arg1 does not contain "off"
# do something
else:
# do something
When you want to find a word in a string, use find()
e.g.
import sys
arg1 = sys.argv[1] # passing the first argumentif arg1.find("off") == -1: # if arg1 does not contain "off"
# do something
else:
# do something
$find . -exec grep “stringyouwanttofind” ‘{}’ \; -print
\; represents the end of argument of exec
{ } inserts each file
$find . -name “filenameyouwanttofind” -print
$ find . -name “*.py” -exec grep “stringyouwanttofind” ‘{}’ \; -print
