Skip to content

Linux file permissions

chmod 664 meaning

664 rw-rw-r--

The owner and the group can read and write; everyone else can read.

When to use 664

Files you and your group both edit, for example uploads and logs written by the web server user in your group.

What each digit allows

Read = 4, write = 2, execute = 1. Each digit is the sum for one group of users.

WhoDigitReadWriteExecute
Owner (u) 6 Yes Yes No
Group (g) 6 Yes Yes No
Others (o) 4 Yes No No

On a folder, read lists its contents, write adds or deletes files in it, and execute lets you open it (cd into it).

Commands

One file or folder, a folder with everything inside it, or only the files inside a folder:

chmod 664 file.php
chmod -R 664 folder/
find folder/ -type f -exec chmod 664 {} +

In cPanel: File Manager → right-click → Change Permissions, and tick the boxes until the number shows 664.

Try other permissions

Tick or untick the boxes to see the number, the symbolic form and the command.

ReadWriteExecute
Owner
Group
Everyone else
Special bits (setuid, setgid, sticky)

Common values

Symbolic

Compare

Frequently asked questions

What does chmod 664 mean?

Each digit is the sum of read (4), write (2) and execute (1), for the owner, the group and everyone else. 664 = 6 / 6 / 4, so the owner and the group can read and write; everyone else can read (rw-rw-r--).

Should I use 664 for files or for folders?

664 suits files. A folder needs execute before anyone can open it, so folders usually get 755 (or 775 when your group must write).

How do I set 664 in cPanel?

In File Manager, right-click the file or folder, choose Change Permissions, and tick the boxes so the number shows 664. Over SSH: chmod 664 path (add -R to include everything inside a folder).

Get new articles in your inbox

Practical tutorials and deep dives, about once a week. No spam, unsubscribe anytime.

Privacy policy

Add DEV Talk to your Home Screen

  1. 1 Tap the Share button in Safari's toolbar.
  2. 2 Scroll down and tap Add to Home Screen.
  3. 3 Tap Add. Open it from the Home Screen to read like an app and to turn on notifications with the bell.

We use cookies to improve your experience and analyze traffic. By continuing, you agree to our Privacy Policy.