with open ('/etc/passwd',"r+") as f:
if "root" in f.read():
print "string found," + " file: " + f.name
string found, file: /etc/passwd
python grep file
Leave a reply
with open ('/etc/passwd',"r+") as f:
if "root" in f.read():
print "string found," + " file: " + f.name
string found, file: /etc/passwd