sudo chmod -R 777 /var/DirectoryName
sudo chmod -R a+rwx path/directory
sudo chmod 777 /path
sudo chmod -R 777 DirectoryName
sudo chown -R testuser:testuser /var/www/test/public_html
chmod -R a+rwx path
only change the no(like 777,775 etc) according to your need
current scenior i am giving full permission to file/sub-directories
chmod -R 777 your_directory_name
To change all the directories to 755 (drwxr-xr-x):
find /opt/lampp/htdocs -type d -exec chmod 755 {} ;
To change all the files to 644 (-rw-r--r--):
find /opt/lampp/htdocs -type f -exec chmod 644 {} ;