Change all files and folders permissions of a directory to 644/755

后端 未结 8 953
孤街浪徒
孤街浪徒 2020-12-04 04:20

How would I change all files to 644 and all folders to 755 using chmod from the linux command prompt? (Terminal)

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-04 05:09

    On https://help.directadmin.com/item.php?id=589 they write:

    If you need a quick way to reset your public_html data to 755 for directories and 644 for files, then you can use something like this:

    cd /home/user/domains/domain.com/public_html
    find . -type d -exec chmod 0755 {} \;
    find . -type f -exec chmod 0644 {} \;
    

    I tested and ... it works!

提交回复
热议问题