Skip to content

Instantly share code, notes, and snippets.

@TimurAykutYildirim
Last active November 13, 2017 12:02
Show Gist options
  • Select an option

  • Save TimurAykutYildirim/3d11b5b4399a046c50a765a4c2e63694 to your computer and use it in GitHub Desktop.

Select an option

Save TimurAykutYildirim/3d11b5b4399a046c50a765a4c2e63694 to your computer and use it in GitHub Desktop.
small python script for searching string within all files of any directory. Should work just fine in any *nix systems
import os
import subprocess
myString = str(raw_input('search key: '))
print myString
myCommand= 'grep -rl "' + myString +'" /Users/timur/Desktop/ems'
print myCommand
os.system(myCommand)
#result = subprocess.check_output([command])
#subprocess.Popen(command)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment