• Blog
  • Papers
  • Datasets
  • Bulk File Management in BASH

    05 May, 2017 | General Hackery

    Two things I want to do often and regularly forget how...

    Renaming a lot of files based on a regex

    To rename all files called '*.apk' with a '.zip' suffix...

    rename 's/^(.+)\.apk$/$1.zip/s' *.apk

    Running a lot of files through a command via a pipe

    for f in *.ttl; do echo "Processing $f file.."; done

    You can also do this...

    for f in `find | grep ttl`; do echo "Processing $f file.."; done