Tools: What `-rwxr-xr-x` Really Means (2026)

Tools: What `-rwxr-xr-x` Really Means (2026)

File mode

How to update the permissions

Numeric mode

Symbolic mode Ever wondered what this -rw-r--r--@ means in this list? This is called the file mode. It shows the file type and the permissions set on that file or directory. Let's break down what each bit represents. The first bit represents the file type. It can indicate a regular file, a directory, or a symlink. Note: A symlink is like a shortcut. It points to another file or directory. The next 9 bits represent the permissions for the file/directory. r represents read permission

w represents write permissionx represents execute permission They come in sets of 3: In this example rwx r-x r-x: You may also notice an extra @ at the end of the output from ls -l on macOS. That is not part of the file mode itself. It usually indicates that the file or directory has extended attributes. We can update permissions with the chmod command.It has two modes that we can use: Let's go through numeric mode first.Each of these permissions in rwx has a number: These numbers are used to represent permissions in numeric form. For example, rwxr-xr-x means the owner has full permissions, while group and others have read and execute permissions. This is written as 755. rwxr-xr-x = (4 + 2 + 1) (4 + 1) (4 + 1) = 7 5 5 Here is a handy table for numeric permissions: Wondering about other combinations, such as -w- ? Yes, they are valid. Some combinations are uncommon or less useful in practice, but experimenting with them in a test directory is a good way to understand how permissions behave. Now let's take a look at symbolic mode, which you can use with chmod. chmod [who][operator][permissions] file

This is the basic structure of symbolic mode. Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to ? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse

Code Block

Copy

-rw-r--r--@ ➜ demo git:(main) ✗ ls -l drwxr-xr-x@ 2 johndoe staff 64 3 Apr 11:12 mydir -rwxr-xr-x@ 1 johndoe staff 0 3 Apr 11:12 myfile ➜ demo git:(main) ✗ ls -l drwxr-xr-x@ 2 johndoe staff 64 3 Apr 11:12 mydir -rwxr-xr-x@ 1 johndoe staff 0 3 Apr 11:12 myfile ➜ demo git:(main) ✗ ls -l drwxr-xr-x@ 2 johndoe staff 64 3 Apr 11:12 mydir -rwxr-xr-x@ 1 johndoe staff 0 3 Apr 11:12 myfile -rwxr-xr-x rwx r-x r-x chmod 444 file # Only read permissions for everyone chmod 544 # Read and execute permission for owner, only read permission for others chmod 444 file # Only read permissions for everyone chmod 544 # Read and execute permission for owner, only read permission for others chmod 444 file # Only read permissions for everyone chmod 544 # Read and execute permission for owner, only read permission for others chmod [who][operator][permissions] file permissions chmod u-rwx file # remove read write execute permissions from user (owner) chmod u+x file # Add execute for owner chmod g-w file # Remove write permission from group chmod a=rw file # Set read and write access for everyone chmod u-rwx file # remove read write execute permissions from user (owner) chmod u+x file # Add execute for owner chmod g-w file # Remove write permission from group chmod a=rw file # Set read and write access for everyone chmod u-rwx file # remove read write execute permissions from user (owner) chmod u+x file # Add execute for owner chmod g-w file # Remove write permission from group chmod a=rw file # Set read and write access for everyone - d represents a directory - - represents a regular file - l represents a symlink - The first 3 bits represent the owner permissions - The second 3 bits represent the group permissions - The third 3 bits represent the permissions for others - rwx represents the owner permissions. The owner can read, write to, and execute the file. - r-x represents the group permissions. Users in the group can read and execute the file, but they cannot write to it. - r-x represents the permissions for others. Everyone else can read and execute the file, but they cannot write to it. - Symbolic mode - Numeric mode - who can be u, g, o, or a: user/owner, group, others, and all - operator can be -, +, or =: remove permission, add permission, or set exact permission - permissions can be r, w, or x