Changing Permission for Files and Folders

While working on ubuntu, some files and folders might not be accessible due to permission settings.
For example it is not possible to add/delete files or folders to /var/lib/mysql folder. But, this is one of the folders that one might one to visit with changes – like if you want to move the data files..
There is a tool in this regard:
1. Go to Applications->Accessories->Terminal
2. on the CLI, write sudo chmod OGE /folder/or/file/path
The first stands for owner, second for group, and third everyone. Each of these are going to be filled with numbers ranging from 1-7.
The permissions primarily include read, write and execute.
the most common for controlled usage is
sudo chmode 777 /folder/or/file/path
which means Owner can read write and execute and the same for Group and everyone
For recursive permission allocation
sudo chmode 777 -R /folder/or/file/path
For more visit https://help.ubuntu.com/community/FilePermissions