Find Files And Delete Recursively

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:...

November 20, 2022 1 min

Bash execute a command N times

How to run a command n times in bash 1 for i in {1..N}; do COMMAND; done

August 7, 2022 1 min