-1

I've got a folder full of thousands of pictures. I want to move all of the .png files back one directory.. I tried

 mv -i *.png ../

But get the following error:

mv: invalid option -- 'p'
Try `mv --help' for more information.

Any advice?

2 Answers2

3

in order to prevent mv from trying to interpret a file with a leading dash (e.g. -pbla.png) as an option (like -p bla.png), you can separate the flags from the files using a double dash --:

mv -i -- *.png ../

another simple way is to prefix the current path ./ to each filename:

mv -i ./*.png ../
umläute
  • 28,885
  • 9
  • 68
  • 122
-1
mv *.png ../

This works on every linux distribution.

umläute
  • 28,885
  • 9
  • 68
  • 122
Sam Aleksov
  • 1,201
  • 6
  • 12