Useful Linux Command
Today I was searching for a good way to change permissions recursively, but only on directories or only on files, because of the vast difference in meaning for the executable flag between the two. Google is a great friend, and led me to a site, whose address I do not exactly remember, but whose advice was perfect:
find . -type d -name public_html -exec chmod 0755 {} \;
Just strip out the -name argument
, and change between -type d
and -type f
to chmod only files or only directories, recursively from the current directory. A great way to correct past misconceptions about the setgid and setuid bits!
February 28th, 2005 at 10:15:42 pm
Bookmarked!
March 1st, 2005 at 12:40:20 am
Notice the \ before the semi-colon. I have no idea what that does exactly, but when I used it that way, it worked, so I didn’t ask questions. I have just noticed that in wordpress, I have to double-backslah to get the single backslash. Looks like an addslashes/stripslashes mismatch!
March 2nd, 2005 at 06:47:18 pm
I think this is what you are looking for… I am assuming that this was taken from a Bash Script…
http://www.gnu.org/software/bash/manual/bashref.html#SEC9
“A non-quoted backslash `’ is the Bash escape character…”
March 2nd, 2005 at 06:49:59 pm
google knows all…