-2

I accidentally saved 100K jpgs to my root folder, I'd like to move just the jpgs and not the other files like my applications folder to a new folder on my desktop. I tried:

home$ mv *.png ~/Desktop/images

But it returns:

-bash: /bin/mv: Argument list too long

Any ideas?

meow-meow-meow
  • 508
  • 2
  • 10
  • 26
  • See [Move all .jpeg from directory structure into one folder on Mac OS X](https://stackoverflow.com/questions/5364579/move-all-jpeg-from-directory-structure-into-one-folder-on-mac-os-x) and add `-maxdepth 1`. – Cyrus Oct 10 '17 at 17:45

1 Answers1

0

This happens because the shell tries to pass all of the parameters to mv. Try

for filename in *.png
do
  mv "$filename" ~/Desktop/images/.
done 

edit: png, not jpg .,.,

Jens
  • 570
  • 3
  • 11