Skip to content

Instantly share code, notes, and snippets.

@jueyang
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jueyang/9349621 to your computer and use it in GitHub Desktop.
Save jueyang/9349621 to your computer and use it in GitHub Desktop.
  • remove extension:

find /path/to/your/files -name '*.html.tmp' -exec sh -c 'mv -i "{}" "$(dirname "{}")/$(basename "{}" .tmp)"' \;

  • add extension:

find /path -type f -not -name "*.*" -exec mv "{}" "{}".jpg \;

or

find . -type f -not -name "*.*" -print0 |\
xargs -0 file |\
grep  'JPEG image data' |\
sed 's/:.*//' |\
xargs -I % echo mv % %.jpg
  • find all files without extension

  • check the file type

  • filter out only JPG files

  • delete filetype info

  • xargs run the "mv" for each file

  • fix gdal

    brew reinstall brew uses --installed sqlite

see Homebrew/legacy-homebrew#12190 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment