-
permissions for directories and files
I have a directory that has both files and directories within it. The permissions for this directory, and all it's recursive contents, are set to 755. I want to recursively set all the permissions for all the files to 644 (-rw-r--r--) and all the directories to 744 (drwxr--r--). How can I do this without editing the files individually? If I do chmod -R 744 ./files/ then the directories will open fine, but the files will have the execute bit set. But if I do 'chmod -R 644 ./files/' all the files will be nonexecutable like i want, but the directories won't open (they need the executable bit). How can I recursively change permissions for files and directories separately? I have read all the chmod and chown docs I can find, and there is no mention of this problem. Any and all help is greatly appreciated.
-
Senior Member
registered user
Re: permissions for directories and files
Try this: Set things to 644 first, then:
Code:
cd your-directory
chmod -cvR 644 .
find . -type d -exec chmod -cv 744 '{}' \;
--The goofy-looking syntax is to escape the "find" parameters so the shell doesn't try to deal with them.

Originally Posted by
mikji
I have a directory that has both files and directories within it. The permissions for this directory, and all it's recursive contents, are set to 755. I want to recursively set all the permissions for all the files to 644 (-rw-r--r--) and all the directories to 744 (drwxr--r--). How can I do this without editing the files individually? If I do chmod -R 744 ./files/ then the directories will open fine, but the files will have the execute bit set. But if I do 'chmod -R 644 ./files/' all the files will be nonexecutable like i want, but the directories won't open (they need the executable bit). How can I recursively change permissions for files and directories separately? I have read all the chmod and chown docs I can find, and there is no mention of this problem. Any and all help is greatly appreciated.
-
That is exactly what I was looking for! Many thanks Dave.
Similar Threads
-
By finder in forum General Support
Replies: 1
Last Post: 04-13-2005, 03:40 PM
-
By finder in forum General Support
Replies: 0
Last Post: 04-13-2005, 01:30 AM
-
By Ezor in forum General Support
Replies: 2
Last Post: 01-04-2005, 07:26 PM
-
By newiaqua in forum Hdd Install / Debian / Apt
Replies: 4
Last Post: 12-26-2004, 07:49 PM
-
By davidc in forum Customising & Remastering
Replies: 0
Last Post: 04-15-2004, 08:15 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules

Original Vintage Old Style STANDARD Black CD Jewel Case (Heavy Duty) 90g Lot
$316.95

Vintage Desktop No Brand-Pentium 4-512MB Ram 40GB HDD ATI R200 Fire GFx OS W98E
$139.99

Vintage NEC CDR-1410A 50 Pin SCSI CD-ROM Optical Drive Used
$39.99

Vintage Teac FD-505 5.25" 3.5" Combo Drive 19307571-00
$199.99

Early Intel 3301 White Cap Vintage Ceramic chip - ALL LEGS INTACT (BO)
$750.00

Intel 8080A Vintage ceramic chip - 1 leg missing w/ some corrosion (BO)
$75.00

MITS 8800 D/C BD REV 1 Blank Circuit Board PCB - Vintage Computer
$49.99

VINTAGE ESS ES1868 16 BIT ISA SOUND CARD COMPAQ 247428-001 - USA SELLER RM2-SC
$24.95

VINTAGE Custom Built Desktop-AMD [email protected] 8GB RAM 80GB HDD NO OS-READ
$160.00

Vintage Mitsubishi CDVR412 CD-RW Optical Drive SCSI 50 Pin Used
$47.99