-
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

One Of A Kind Homemade Vintage Mainframe Computer, Logic Module Wood Bookends
$149.00

Vintage Telex 952003-112 Mechanical Terminal Keyboard IBM 3270 Mainframe DB25
$594.99

HP 13210-60001 Disc Drive Interface PCB HP 7900A 7901A Vintage
$157.93

HP 5060-8359 8K Semiconductor Memory Module 5080-9747 Vintage HP Computer
$157.30

Vintage Japanese Katakana Double Shot Sperry Univac UTS 4000 Keyboard 1981
$199.99

LOT of 14 DATA 100 Corporation Mainframe Terminal Boards Memory Backplane Gold
$749.99

Vintage Mainframe Computer Disk Drive Pack Dyson SMD 5 Level Disks
$69.00

3x Various Brands 10.5", 8.5" & 7" Mainframe 9-Track Reel Computer Data Tape .5"
$34.99

Vintage Intel Mainframe Server MCM CPU Substrate Lot Prototyping PGA Validation
$500.00

VINTAGE Artecon LX-1558FN HDD EOD SubSystem Mainframe POWERS ON RARE
$299.99