Your secret spy resident for Linux, web server and hardware

How to set permission of folder or file in Linux

You can set permission for the folder or file in Linux system by using command chmod.

For instance to setup the /test folder permission to 777 you need to type: chmod 777 /test.

To check that 777 is really set use stat command: stat /test

You can clearly see that folder is set to 777 permission.

To process bundle action with folders and sub folders use the following example: chmod –R /test. This will setup all folders, files and subfolders to 777.

However there might be another way to do it either for folders&subfolders: find /test/ -type d -exec chmod 777 {} \;

or for the all files in all folders and subfolders: find /var/www -type f -exec chmod 777 {} \;

Be very careful with permission 777, this is shown only for example purposes.

Exit mobile version