recursive change of permissions
Hi,
I wan't to change the permissions of a folder and it's subfolders and all the files in it, but I can't figure out how to do it and get the folders and files to have different permisions from eachother? After some man reading and googling :study: I tried first setting all to 775, and then I wanted to change all the mp3 files to 664. so my latest atempt was: chmod -R 775 * ls -R | grep 'mp3' || chmod 664 But that last command did nothing ls -R | grep 'mp3' | more gave me a list of all the mp3 files, not sure what exactly I'm doing wrong :confused: Is there some way of doing this, that dosn't require that I go thru thousands of files one by one ? |
"chmod -R 755 *.mp3" should work
|
Or my all-time favourite, find! :)
find </start/dir/name> -iname "*mp3" -exec chmod 664 {} \; Cheers, Tink |
Quote:
chmod: failed to get attributes of `.mp3': No such file or directory But thank you for the quick reply :) Trying the Find command now .. *chuck chuck* ooh that took a while I have to many mp3's hehe, but it worked WEEEE! Thank You Tinkster! |
oh duhh.... yeah that was a stupid suggestion sorry. the *.mp3 will simply match the existing files in that directory, not a patten match for chmod. what a fool.....
listen to Tink instead. |
If you want to stick with your original method - all you were missing was backticks:
chmod -R 775 `ls -R | grep 'mp3'` or something like that *might* work. Give it a try. Muzzy. |
*.mp3 not .mp3
|
thx, all cli knowledge goes into my notebook, so I'll have more fun next time ;)
|
Quote:
;) Quote:
Cheers, Tink |
All times are GMT -5. The time now is 12:36 PM. |