Reputation: 25
From what I can tell, I've run into a limitation of chmod - hoping to pick the more experienced brains here before resorting to writing some find scripts.
I would like to chmod -R all files & directories within a folder, but leave the folder itself alone. I need to avoid the permissions of the starting directory changing, at all during this process, so a simple chmod -R followed by a non recursive chmod to reset the permissions on the starting directory isn't an option.
Any ideas?
Upvotes: 2
Views: 1177
Reputation: 123490
Simply give chmod
all the files and subdirectories inside the directory, rather than the directory itself. This is easily done with a glob pattern:
chmod -R dir/*
If you want to account for hidden files and dirs, you can shopt -s dotglob
in bash.
Upvotes: 3