What Does chmod 777 Mean in Linux?

In Linux, the chmod command is the primary catalyst to grant the permissions to read, write, and execute to the users. The chmod changes the permissions using the alphabetical or the octal representation. The chmod 777 is an octal set of permissions for a directory or file. A file or directory having the “chmod 777” permissions can be read, written, and executed by all the users. 

This post will demonstrate the purpose and functionality of the chmod 777 in Linux with the following outcomes: 

How to Use the chmod Command in Linux?

The chmod command utility is used to change the modes of the files; for example, we can make the files readable using the chmod command. The syntax of the chmod command is provided as follows:

$ chmod [Options] [Filename]

The “Options” is replaced by either the alphabetical notation or the octal representation of the permissions. For more details on options and usage, run the following command in the terminal:

$ chmod --help

A general description of the permissions in Linux is shown below:

The first dash (-) represents that it is a file. While the next three sets of three dashes show the permissions for the owner, Groups, and Others.

What Does chmod 777 Mean in Linux? 

Before getting into the chmod 777, let’s have a look at the 

Permissions in Octal and Alphabetical Notations:

PermissionsOctal Notation Alphabetical Notation
Read4r
Write2w
Execute1x

777 Permission:

The chmod 777 refers to all three permissions, i.e., read, write, and execute and these permissions  are to be granted to owners, groups, and others. 

PermissionsReadWrite ExecuteTotal
Owner4217
Groups4217
Others4217

How to Apply chmod 777 to a File in Linux?

As demonstrated in the above table, the 7 is formed as follows:

7 = 4(Read) + 2(Write) + 1(Execute)

Before Using chmod 777:

Let’s check the permissions of a file before using “chmod 777” in Linux:

After Using chmod 777: 

Now, let’s apply the “chmod 777” as described below: 

$ chmod 777 test.txt

The output shows that the file has now allowed all the sets of users to read, write, and execute it. 

Conclusion

The chmod 777 means that all the file users, including the owner, group members, and the other users, have all the privileges (read, write, and execute) of the file. This post has explained the basic working of the chmod command alongside its application on files/directories.