For a Windows user, the only place where you will see the file permission stuff is at the website host/server. But, your hosting plan needs to be with the Linux operating system. So, the exact reason behind the the existence of such file systems is the Linux OS. Now, any other operating system which depends on Linux, is going to use such file permissions, for example, the Mac OS X.
I am writing this guide to help you in understanding file permissions and especially what does “Chmod 777” means. If we break this term in two parts, then it will be easy for us first to understand two different things and then combine the results.
In starting itself I should share one key aspect of this guide, i.e., it is going to be little lengthy as I have to explain a lot of related stuff in order to explain the correct and complete meaning of this file permission related code.
What is Chmod?
If you have operated any Linux based then you must be aware of the fact that we have to learn different commands. Linux is generally not considered as a GUI tool, like Windows, rather, it depends on commands.
So, Chmod command is meant to perform an action, and that action is, to change the file permission.
There are different file permission codes available in a Linux ecosystem and to change it for any particular file or folder, you need to use this Chmod command. Without it, you will not be able to execute the command i.e. the file permission will not be changed.
I hope you don’t need any further explanation on this term. If it is still not clear, then don’t worry, move ahead to the next section. Once you are aware of what a file permission is, then you will understand the true meaning and application of this term ‘Chmod 777’.
What is File Permission?
To understand this concept of file permission, you need to understand each and every related element. Let’s begin with the permission types first.
There are three types of permissions a person can get over a given file, which are as following,
Read – This permission allows a user to only read the given file. This allows the person to only view a given file. Generally, read permission is available for public views.
Write – Write permission is offered to a user who is authorized to not just read/view a file but can also edit it. Such a user is allowed to not only add data to a file but can also add other files to a folder.
Execute – This is the last permission which provides complete access. It allows that given user can read, edit and do execution on the data. The execution generally means running a script.
Now with those permissions, there is a set of users attached. There are three types of users generally classified in this File Permission situation.
Owner – As the name suggests, it clearly indicates the person who owns that given file of which we are talking at a particular situation.
Group – A group of people who have their privilege on a given file is labeled a Group.
Others – Others indicates the public. Any person in the world is counted in its domain.
I can understand that you are confused so far, but if you combine these two Permissions and Classes of users together, then you will paint a clear picture.
The Owner user generally holds all three types of permissions, while a Group can have either Read and Write or just the Read. The last, Public user always have the Read permission, but not any other.
I hope this classification so far is clear you to now. This is a simple and cool way to not only classify a file but also think over how it can be distributed and used.
Moving ahead in the same chapter, it’s time for you to understand what do those numbers mean. It is not a new thing to you that computers don’t understand words or letters. They understand only the numbers and execute them.
So, to offer the computers an easy ground, we divide our classifications into numbers and resemble them accordingly.
Read is equivalent to number ‘4’
Write is equivalent to number ‘2’
and, Execute is equivalent to number ‘1’
This is the base, and to offer a combination of these permissions to a user, the computer adds the related numbers and comes out with a proper number code. For your ease at this moment, I have written the number and the file permission they reflect.
No permission – 0
Execute – 1
Write – 2
Write and Execute – 3
Read – 4
Read and Execute – 5
Read and Write – 6
Read, Write, and Execute – 7
Understood till now? If you grasp everything above, then it’s time to move ahead and get the real meaning of Chmod 777.
Now, as you can see, there are three numbers in this code. But, we have learned about only single of them.
The number at the first position is for Owner’s permission, the second is for Group’s permission and the third one is assigned to the Public user.
So, the 777 code clearly means that all three users (Owner, Group, and Public) can perform all three operations on a file i.e. Read, Write and Execute.
So, what exactly ‘Chmod 777’ does?
Since, you’re aware of every related term now, so I hope you have already figured out the answer to this question. Write that answer on a paper without reading the next line and see if your answer matches with the correct one.
The ‘Chmod 777’ code means changing the Permission of a given file to 777, from any previous one.
Was your answer correct? Let’s share it in the discussion section below.