With a little side of applesauce...

Tuesday, October 18, 2011

BASH - useful recursive chmod aliases

I am always performing chmod operations on folders and files, and wrote a couple of quick BASH functions (.bashrc) to help me:
function recursivechmoddir() { for d in $(sudo find ${2} -type d); do sudo chmod -R ${1} ${d} ; done; }

function recursivechmodfile() { for f in $(sudo find ${2} -type f); do sudo chmod -R ${1} ${f} ; done; }

No comments: