Skip to main content
deleted 1 character in body
Source Link

I have a folder on my desktop named Models. In the folder, there are named folders with jpeg files without the .jpg extensions. The jpeg file names are random hashes. I would like to use a bash script to batch rename these jpeg files to their directory names with increments and append the .jpg extension on each file.

It's basically something like

Models/

  Alice/
      a5ccB2ff3e
      ee420bc4a
      2acee54dc
      ...
 Alex/
      de33fa24c0
      d1eaa48e0a
      ...

And I want to to be like

Models/

 Alice/
      Alice001.jpg
      Alice002.jpg
      Alice003.jpg
      ...

 Alex/
      Alex001.jpg
      Alex002.jpg
      ...
   
      

I have a folder on my desktop named Models. In the folder, there are named folders with jpeg files without the .jpg extensions. The jpeg file names are random hashes. I would like to use a bash script to batch rename these jpeg files to their directory names with increments and append the .jpg extension on each file.

It's basically something like

Models/

  Alice/
      a5ccB2ff3e
      ee420bc4a
      2acee54dc
      ...
 Alex/
      de33fa24c0
      d1eaa48e0a
      ...

And I want to to be like

Models/

 Alice/
      Alice001.jpg
      Alice002.jpg
      Alice003.jpg
      ...

 Alex/
      Alex001.jpg
      Alex002.jpg
      ...
   
      

I have a folder on my desktop named Models. In the folder, there are named folders with jpeg files without the .jpg extensions. The jpeg file names are random hashes. I would like to use a bash script to batch rename these jpeg files to their directory names with increments and append the .jpg extension on each file.

It's basically something like

Models/

 Alice/
      a5ccB2ff3e
      ee420bc4a
      2acee54dc
      ...
 Alex/
      de33fa24c0
      d1eaa48e0a
      ...

And I want to to be like

Models/

 Alice/
      Alice001.jpg
      Alice002.jpg
      Alice003.jpg
      ...

 Alex/
      Alex001.jpg
      Alex002.jpg
      ...
   
      
Source Link

Rename multiple files in sub directories to their directory names

I have a folder on my desktop named Models. In the folder, there are named folders with jpeg files without the .jpg extensions. The jpeg file names are random hashes. I would like to use a bash script to batch rename these jpeg files to their directory names with increments and append the .jpg extension on each file.

It's basically something like

Models/

  Alice/
      a5ccB2ff3e
      ee420bc4a
      2acee54dc
      ...
 Alex/
      de33fa24c0
      d1eaa48e0a
      ...

And I want to to be like

Models/

 Alice/
      Alice001.jpg
      Alice002.jpg
      Alice003.jpg
      ...

 Alex/
      Alex001.jpg
      Alex002.jpg
      ...