Changing file permissions recursive in script
Hi Is there a easy way to change file permissions to 0744 in every sub-dir by running a script/command from the "master" directory? Jaska.
* Anders Johansson (andjoh@rydsbo.net) [021031 11:45]:
Is there a easy way to change file permissions to 0744 in every sub-dir by running a script/command from the "master" directory?
chmod -R 0744 *
That will get directories and miss dot-files though. find /dir -type f -exec chmod 0744 {} \; -- -ckm
Hi That is what I was looking for... I really need to get into bash-scripting.. Jaska. On Thursday 31 October 2002 21:48, Christopher Mahmood wrote:
* Anders Johansson (andjoh@rydsbo.net) [021031 11:45]:
Is there a easy way to change file permissions to 0744 in every sub-dir by running a script/command from the "master" directory?
chmod -R 0744 *
That will get directories and miss dot-files though. find /dir -type f -exec chmod 0744 {} \;
On Thursday 31 October 2002 20.48, Christopher Mahmood wrote:
* Anders Johansson (andjoh@rydsbo.net) [021031 11:45]:
Is there a easy way to change file permissions to 0744 in every sub-dir by running a script/command from the "master" directory?
chmod -R 0744 *
That will get directories and miss dot-files though. find /dir -type f -exec chmod 0744 {} \;
It won't miss dot-files if you give the toplevel directory name chmod -R 0744 /dir It will get directories though, but that wasn't specified in the question. It said "file permissions" and a directory is a file :) Anders
Hi This was due to fact, that I was collecting a lot of documents and other stuff from various places, also from M$-HDs that I had termporarily installed to my PC, so all the permissions were totally wrong, and thus some files were inaccessible from my normal user account.. There were over 1.300 files, and I really did not want to go thru them by hand.. I had no dot-files, just plain documents, music, texts etc etc... This command took some 20sec to run, and everything was perfect after that. Thanx for perfect command for me. Jaska. On Thursday 31 October 2002 23:36, Anders Johansson wrote:
On Thursday 31 October 2002 20.48, Christopher Mahmood wrote:
* Anders Johansson (andjoh@rydsbo.net) [021031 11:45]:
Is there a easy way to change file permissions to 0744 in every sub-dir by running a script/command from the "master" directory?
chmod -R 0744 *
That will get directories and miss dot-files though. find /dir -type f -exec chmod 0744 {} \;
It won't miss dot-files if you give the toplevel directory name
chmod -R 0744 /dir
It will get directories though, but that wasn't specified in the question. It said "file permissions" and a directory is a file :)
Anders
participants (3)
-
Anders Johansson
-
Christopher Mahmood
-
jaakko tamminen