title: Replace a string in all files - Unix
body: <p>I am trying to replace a string <code>:::</code> with <code>::</code> for all lines in a batch of txtfiles (it can be considered as a word since there's always a space in front and behind it. </p>
  
  <p><strong>I can do it with python like below, but is there a less 'over-kill' / convoluted way of doing this through the unix terminal?</strong> (Many pipes allowed)</p>
  
  <pre><code>indir = "./td/"
  outdir =  './od/'
  for infile in glob.glob(os.path.join(indir,"*")):
    _,FILENAME = os.path.split()
    for l in codecs.open(infile,'r','utf8').readlines():
      l = l.replace(":::","::").strip()
      outfile = codecs.open(os.path.join(outdir,FILENAME),'a+','utf8')
      print&gt;&gt;outfile, l
  </code></pre>
  
  <p>Then i move all files from od to td <code>mv ./od/* ./td/*</code></p>