Linux: Setting chmod for a folder and its subfolders and files

1152140 pts.
Tags:
Linux
Ubuntu
Does anybody know if there's a way to set "chmod 755" for /opt/lampp/htdocs and it's content including subfolders and files? And if I create a new folder, can the chmod be automatically set to 755? Sometimes, this works but only for this folder.
chmod 75 /opt/lampp/htdocs
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Brijesh
    You can use the below commands to set the directories permission to 755 and file permission to 644,

    chmod 755 $(find /path/to/base/dir -type d)
    chmod 644 $(find /path/to/base/dir -type f)


    To set "chmod 755" for "/opt/lampp/htdocs" use the command,

    find /opt/lampp/htdocs -type d -exec chmod 755 {} \;


    14,450 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: