Loop through directories and execute a command on Linux -


ex: {pwd} /home/vrm/ directory has 100 directories inside it. dir2, dir2, dir3 , on..

i want go each of these directories , execute command (say psh make clean).

how do it? please advise.

i use following traverse directories

find . -type d -print0 | while read  -d $'\0' dname; echo "dir: ${dname}"; done 

be sure double-quote variable dname, may have spaces inside.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -