Change File/Folder Permission,Owner/Group Permission Through The Terminal In Linux/Ubuntu



Some times we want to change the file permission as well as the file owner and group through the terminal then it is very important that you have the access of the root user so that you can change the file/folder owner, group and the file/folder permission. Follow the steps to change the owner/group and the file/folder permission.

Step 1. Open the terminal.
Step 2. Login through the SSH

ssh {user_name}@{host_name}

Step 3. Press Enter then it will ask for the Password after entering the Password you will be logged in.
Step 4. Navigate to the folder/file for which you want to change the permission as well as the owner/group

Change the file and folder permission

chmod 777 {folder/file name}* -R
chmod 777 media* -R

-R means recurcively it will change the permission of all the files as well as the folder of the media folder.

Change the file and folder owner and group

chown -R {owner name}:{group name} {folder/file name}
chown -R {owner name}:{group name} media

then it will change the owner and group of the media folder.

Hope this will help to someone.