[opensuse] recursively chmod files only
Hello: I would like to recursively remove write permission of a directory but to keep write and access permissions for the directories. How can I do this? TIA, IG ________________________________________________________ 35% kedvezménnyel a Kossuth Kiadó minden kapható könyve április 30-án a Bookline-on! http://bookline.hu/control/news?newsid=397&tabname=book&affiliate=frekszkar5916 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Saturday 03 May 2008 06:37:08 Istvan Gabor wrote:
I would like to recursively remove write permission of a directory but to keep write and access permissions for the directories. How can I do this?
I normally do the following: find <directory> -type d -exec chmod <permissions> {} \; find <directory> -type f -exec chmod <permissions> {} \; Hope this helps. -- Regards Scott Newton -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Fri, 2008-05-02 at 20:37 +0200, Istvan Gabor wrote:
Hello:
I would like to recursively remove write permission of a directory but to keep write and access permissions for the directories. How can I do this?
Impossible. You cannot both keep and remove write permissions on the same thing. I suspect you mean something slightly different? Remove write from files but keep it for directories. starting in the current directory: find . -type f -exec chmod a-w {} \; It is how I would do it. Of course, there are probably other ways. If you leave off the -exec stuff, it will print the files to will change the permissions of. -- Roger Oberholtzer OPQ Systems / Ramböll RST Ramböll Sverige AB Kapellgränd 7 P.O. Box 4205 SE-102 65 Stockholm, Sweden Tel: Int +46 8-615 60 20 Fax: Int +46 8-31 42 23 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Impossible. You cannot both keep and remove write
Scott, Roger: Thank you for the really quick answers. permissions on the
same thing. I suspect you mean something slightly different?
I might have not made it clear. I want to remove the write permissons of the directories and keep it for the files.
Remove write from files but keep it for directories.
starting in the
current directory:
find . -type f -exec chmod a-w {} \;
This is what I need, I guess. I check how it works. Thank again, IG ________________________________________________________ 35% kedvezménnyel a Kossuth Kiadó minden kapható könyve április 30-án a Bookline-on! http://bookline.hu/control/news?newsid=397&tabname=book&affiliate=frekszkar5916 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Fri, 2 May 2008, Istvan Gabor wrote:-
I might have not made it clear. I want to remove the write permissons of the directories and keep it for the files.
Then this should do the job: find . -type d -print0 | xargs -0 chmod 555 ^ ^ These are the number not the letter. You could use: find . -type d -exec chmod 555 '{}' \; to do the same job. The only difference between them is that the former starts up the minimum number of instances of chmod, where as the second one won't complain if there are no directories to actually chmod. Regards, David Bolt -- Team Acorn: http://www.distributed.net/ OGR-P2 @ ~100Mnodes RC5-72 @ ~15Mkeys SUSE 10.1 32bit | openSUSE 10.2 32bit | openSUSE 10.3 32bit | openSUSE 11.0b1 SUSE 10.1 64bit | openSUSE 10.2 64bit | openSUSE 10.3 64bit RISC OS 3.6 | TOS 4.02 | openSUSE 10.3 PPC | RISC OS 3.11 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Friday 02 May 2008 21:09:23 David Bolt wrote:
On Fri, 2 May 2008, Istvan Gabor wrote:-
I might have not made it clear. I want to remove the write permissons of the directories and keep it for the files.
Then this should do the job:
find . -type d -print0 | xargs -0 chmod 555 ^ ^ These are the number not the letter.
You could use:
find . -type d -exec chmod 555 '{}' \;
to do the same job. The only difference between them is that the former starts up the minimum number of instances of chmod, where as the second one won't complain if there are no directories to actually chmod.
Since the OP talked about removing permissions, and not stating what was there in the first place, perhaps find . -type d -exec chmod -w {} \; Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Friday 2008-05-02 21:09, David Bolt wrote:
On Fri, 2 May 2008, Istvan Gabor wrote:-
I might have not made it clear. I want to remove the write permissons of the directories and keep it for the files.
Then this should do the job:
find . -type d -print0 | xargs -0 chmod 555 ^ ^ These are the number not the letter.
You could use:
find . -type d -exec chmod 555 '{}' \;
to do the same job. The only difference between them is that the former starts up the minimum number of instances of chmod, where as the second one won't complain if there are no directories to actually chmod.
The first one does not complain either if you add -r to xargs, read the manpage. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (6)
-
Anders Johansson
-
David Bolt
-
Istvan Gabor
-
Jan Engelhardt
-
Roger Oberholtzer
-
Scott Newton