I have a folder with several hundreds of folders inside it. These folders contain another folder each, called images, and in this folder there is sometimes a strictly numerically named .jpg file. Sometimes there are other JPG files in the folder as well, but these need to be ignored if they aren't strictly numeric.

I would like to learn how to write a script which would, when run in a given folder, traverse every single subfolder and look for this numeric file. It would then add the "\_n" suffix to a **copy** of each, if such a file does not already exist.

Can this be done through the unix terminal easily?

To be more specific, this is the structure I'm dealing with:

* master folder
	+ 18556
		- images
			* 2234.jpg
	+ 47772
		- images
			* 2234.jpg
			* 2234\_n.jpg
			* some\_pic.jpg
	+ 77377
		- images
	+ 88723
		- images
			* 22.jpg
			* some\_pic.jpg

After the script is run, the situation would look like this:

* master folder
	+ 18556
		- images
			* 2234.jpg
			* 2234\_n.jpg
	+ 47772
		- images
			* 2234.jpg
			* 2234\_n.jpg
			* some\_pic.jpg
	+ 77377
		- images
	+ 88723
		- images
			* 22.jpg
			* 22\_n.jpg
			* some\_pic.jpg

Update: Sorry about the typo, I accidentally put 2235 into 47772.
Update 2: Regarding the 2nd comment on the mathematical.coffee's answer, the OS I am currently on (at work) is MacOS, but my main machines are running CentOS and Ubuntu at home, so I just assumed my situation applies to all unix based systems.