16 lines
322 B
Bash
Executable file
16 lines
322 B
Bash
Executable file
#!/usr/bin/env bash
|
|
#
|
|
|
|
mkdir "portraits"
|
|
mkdir "landscapes"
|
|
for f in ./*.{jpg,jpeg,png,gif}; do
|
|
if [ -f "$f" ]; then
|
|
WIDTH=$(identify -format "%w" "$f")> /dev/null
|
|
HEIGHT=$(identify -format "%h" "$f")> /dev/null
|
|
if [[ "$HEIGHT" > "$WIDTH" ]]; then
|
|
mv "$f" portraits/
|
|
else
|
|
mv "$f" landscapes/
|
|
fi
|
|
fi
|
|
done
|