Problem

Sometimes when using monorepos to host multiple services in a single repository, there may be a requirement to delete a file or list of files from each microservice. For example, I needed to delete application-dev.yml files for all the services after getting rid of dev environment in favor of acceptance.

Solution

Use following find command to find application-dev.yml files recursively and delete them.

1
find . -name "application-dev.yml" -type f -delete

we may also use glob filters while using find:

1
find . -name "application-d*.yml" -type f -delete