How to chmod 777 recursively for all files within a folder?

Harry P

Well-known member
Registered
Joined
Feb 3, 2015
Messages
447
Points
28
Hey Guys,
I would like to ask what should I do if I like to chmod 777 recursively for all files within a folder? when I need chmod 777 for my files?
Thanks in advance!
 

EcommIndiaCloudIT

Member
Registered
Joined
Dec 28, 2016
Messages
64
Points
0
Warning: Unless you know exactly what you are doing and why you're doing this. Do not execute these commands.

Any of the below should work. Just switch between f(file) and d(directory):

find . -type f -perm 644 -exec chmod 777 {} \;
find . -type f -exec chmod 777 {} \;
find . -type f -print0 | xargs -0 sudo chmod 777

Easier:
find . -type d -exec chmod 0777 {} \;
find . -type f -exec chmod 0777 {} \;
 

LJSHost

Well-known member
Hosting Provider
Registered
Joined
Jul 5, 2016
Messages
1,031
Points
63
Hi Harry


This example will change every file to 777 in the /home/user/directory and above.

chmod -R 777 /home/user/directory

Unless you have a specific reasons for doing this 777 is very bad idea.
 
Older Threads
Replies
5
Views
2,438
Replies
5
Views
4,718
Replies
15
Views
11,200
Similar Threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top