1
0
I have following folder structure:
/[randomChars]/icons/icon_[randomNumbersAndChars]
For example:
/awbwaidhawd/icons/icon_1241245
/awbwaidhawd/icons/icon_1552542
/awgawbvbbbb/icons/icon_1552542
/aawbbbbbbbb/icons/icon_1161266
I need to grab all icon files recursively, add the file extension ".png" to them and copy them to another folder.
That means I want to achieve following result:
/icon_1241245.png
/icon_1552542.png
/icon_1552542.png
/icon_1161266.png
For that I want to use standard bash linux scripting.
How could you achieve that?
EDIT:
Maybe I should add that there are more subfolders in the first layer that are not important. That means there exsists for example a folder like:
/awbwaidhawd/avatars/
Such folders should not be scanned.
Additionally, in a "icons" folder there can be files that are not named "icon_xxxxx". Those files should not be moved too.
What have you tried so far? Super User is not a script writing service; sole requests for code may not get much (positive) attention. If you [edit] the question and show your research effort (post the exact commands you tried, tell us where you are stuck) then you will increase your chances for a good answer. – Kamil Maciorowski – 2019-01-30T00:12:38.983