I'm trying to rename a lot of files in Kali Linux, nearly 16,000 of them. They're arranged in nearly 600 folders with random numbers for names, and the files in them are labelled as 0,1,2... (No file extn.) starting from 0 again in each new folder. I'm trying to convert the files into a .jpg format. The following code works only when I open the folder directory in terminal-
find . -name '[0-9][0-9][0-9]' -exec sh -c 'mv $0 $0.jpg' {} \;
find . -name '[0-9][0-9]' -exec sh -c 'mv $0 $0.jpg' {} \;
find . -name '[0-9]' -exec sh -c 'mv $0 $0.jpg' {} \;
But to do this for each and every folder in the directory is going to be rather tedious. Any suggestions for a .sh executable script?
Edit: The extension has to be changed, the names, can remain as they are...