Skip to main content

Renaming hundreds of non-empty directories [Resolved]

OS is Centos 7

I've looked for a couple days now and feel like I should have found something for this by now.

I have hundreds and hundreds of directories like the following:


And I need to change 'webapp' to 'new_webapp'

Both /tmp/ and /app/ are constant but the users and the content under the directory to be renamed is unknown and varied. Every existing directory structure is not empty.

I have not found a way to succinctly do this without manually slogging through each directory with a laborious shuffling of files in and out of directories and I'm hoping someone might know of a more efficient way.

Question Credit: user2752794
Question Reference
Asked July 20, 2019
Tags: rename
Posted Under: Unix Linux
2 Answers

Your Answer