Skip to content

Instantly share code, notes, and snippets.

@dbernheisel
Created February 21, 2015 04:52
Show Gist options
  • Select an option

  • Save dbernheisel/2523aa5451e6eb1dbc9c to your computer and use it in GitHub Desktop.

Select an option

Save dbernheisel/2523aa5451e6eb1dbc9c to your computer and use it in GitHub Desktop.
Separate files into new folders by ISBN13 (no dashes)
#/bin/bash
# Separate ISBNs to folders named by ISBN
for f in 978*.*; do
isbn=${f:0:13}
if [ ! -d $isbn ]; then
echo Creating folder for $isbn
mkdir $isbn
fi
mv -v $f $isbn
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment