Change File Permission in UBUNTU

Change File Permission  in UBUNTU

What is File Permissions?

In Linux everything is a file. Directories are files, files are files and devices are files. Devices are usually referred to as a node; however, they are still files. All of the files on a system have permissions that allow or prevent others from viewing, modifying or executing. If the file is of type Directory then it restricts different actions than files and device nodes. The super user “root” has the ability to access any file on the system. Each file has access restrictions with permissions, user restrictions with owner/group association. Permissions are referred to as bits.

To change or edit files that are owned by root, sudo must be used.

To change permission of a specific folder or file, use below command

//Where /var/www/html is a folder path 
sudo chmod 777 /var/www/html

This command will change permission of html folder only, if you also want to change permission of internal files too then use below command

//Where /var/www/html is a folder path
sudo chmod -R 777 /var/www/html