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
Post a Comment