Set Permisssions differently on files and folders
Posted on 2006-07-03
My problem is as follows:
What i want to do is set the mode of files and directories differently (including hidden files and hidden directories)
So lets say i want to make all files 0640 and the directories 6750
I know i can always recursively set the permissions on everything by typing:
chmod -R 0640 *
but is there a way to pick up every subdir and give it different values without manually going through each directory?
The directories i'm refering to have many nested files and folders so the manual process of first setting the files permissions is easy, but setting the folders is boring.
I presume this can be achieved with the recursive option in chmod and some intelligent use of grep, but i have no idea how.
Any help would be greatly appreciated.