문제

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?

도움이 되었습니까?

해결책

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 ../

다른 팁

mv *.png ../

This works on every linux distribution.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top