This article for you to introduce a Linux batch setup folder 755 Web page File 644 Permissions example, I hope this tutorial can help you.
Web site relocation, especially from virtual space or Windows to the Linux VPS will appear file permissions problems, usually the directory is 755 permissions, the file is 644 permissions.
first, CD to the site directory you want to modify, and then run the following two commands to quickly bulk Modify permissions.
find-type D|xargs chmod 755
find-type F|xargs chmod 644
In addition, often using SFTP to modify the upload of new files is the root user group, can be modified to the WWW user group, the command is as follows:
chown-r www:www/home/wwwroot/Site Directory
Here's another way to add
Method 1
find.-exec sh-c "If [[-D" {} "]]; Then chmod 755 "{}"; else chmod 644 "{}"; Fi "\;
Method 2
find./-type f-print |xargs chmod 644;
find./-type d-print|xargs chmod 755;
Method 3
frequently used commands, record them.
Find/path-type f-exec chmod 644 {} \; Set file permissions to 644
find/path-type d-exec chmod 755 {} \; Set directory permissions to 755
Recommended Method:
chmod 644-r./
find./-type d-print|xargs chmod 755;
Method 1 and Method 2 are found online, when the test found that the setting of 644 is a bit of a problem.
So, the recommended method inside, I first use chmod all set 644, then use Find to set the directory portion to 755.
Note./Is the directory settings that are located in the site code.
Linux Bulk Modify folder 755 file 644 Permissions