0

I am using Ubuntu 16.04 LTS, 64 bit.

I have a folder full of 44 jpeg files with the following naming format—

0094-001.png.jpeg
0094-002.png.jpeg
…
0094-044.png.jpeg

I want to change them all into files with the following naming format—

0094-001.jpeg
0094-002.jpeg
…
0094-044.jpeg

I attempt the following command in the terminal—

mv ./*.png.jpeg ./*.jpeg

I get the following error—

mv: target './0094-044.png.jpeg' is not a directory

Why?

Elen Sila
  • 435
  • 2
  • 5
  • 14
  • Because mv simply doesn't work that way (although mmv does - kinda, the replacement syntax is different). It moves (renames) a single file to a single target, or moves multiple files to a single target directory. – steeldriver Feb 17 '18 at 20:01
  • I don't think you can use the wildcard (*) in the destination name. You will probably need to use a script to do this. – ravery Feb 17 '18 at 20:01
  • https://unix.stackexchange.com/questions/181141/rename-multiple-files-with-mv – mook765 Feb 17 '18 at 20:23

0 Answers0