I have a bunch of directories (e.g., drawable-hdmi, drawable-en-hdmi, drawable-en-xhdmi) and so on for different resolutions and localisations. each of them contain just one file with a random name. How can I rename those files with a command to to new_begingn.9.png?


Use find with mv:

find drawable-hdmi drawable-en-hdmi drawable-en-xhdmi -type f -exec mv {} new_begingn.9.png \;

If all the folders are named drawable-<something>, you can do:

find drawable-* -type f -exec mv {} new_begingn.9.png \;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.