How to set permissions to files and folders in Linux terminal

There are there types of file permissions in Linux:

1. Owner permissions
2. Group permissions
3. Other permissions

Also you can set permissions for read, write and execute file for this three groups.

To set correct permissions for all files and folders in currend folder use command:

find . -type f -print0 | xargs -0 chmod 644
find . -type d -print0 | xargs -0 chmod 750

This commands will grant readm write, execute access for owner, read access for group and block all access for other users.

If you wand to grant access to files and folders for other users use commands:

find . -type f -print0 | xargs -0 chmod 665
find . -type d -print0 | xargs -0 chmod 751