How to set permission of folder or file in Linux

0

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.

change persmission linux

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

check folder permission in Linux

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.