Shell

ImageMagick logo

As ‘man convert’ states :

The convert program is a member of the ImageMagick suite of tools. Use it to convert between image formats as well as resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more.

For example, to substitute foo with bar

for f in `grep -lR foo`; do
  echo -n ">> $f";
  sed 's/foo/bar/g' $f > $f.2;
  mv $f.2 $f;
  echo " done.";
done
  • for loops on all files containing the text “foo”, grep -l only show the file name with corresponding text inside.
  • sed replace foo with bar in all file
  • mv save the modification (delete if you don’t want to overwrite the original files, the modified files is named with .2 at the end)

The fastest and more efficient way to batch multiple files encoding conversion :

vim +"argdo se fileencoding=utf-8 | w | bnext" +"q" ` find . -type f -name "*.rsp"

+“argdo” : execute the following vim commands for each file (filencode, save and next buffer)