breakitdown

chmod 644 (rw-r--r--)

Answer

chmod 644 sets rw-r--r--: the owner can read and write, and the group and everyone else can only read. It is the normal mode for ordinary files that are not secret and not executable.

Try

chmod 644 = rw-r--r--: owner read and write, everyone else read.

Read 4Write 2Execute 1Digit
Owner (user)6
Group4
Others4
Special0
  1. 6
    Owner (user): 6 = 4 read + 2 write
  2. 4
    Group: 4 = 4 read
  3. 4
    Others: 4 = 4 read

On a file

  • Owner (user) read it and change it
  • Group read it
  • Others read it

On a directory

  • Owner (user) list the names inside; write without x does nothing useful (names only: without x the files cannot be opened or even stat'ed)
  • Group list the names inside (names only: without x the files cannot be opened or even stat'ed)
  • Others list the names inside (names only: without x the files cannot be opened or even stat'ed)

chmod 644 filechmod u=rw,go=r filels -l → -rw-r--r--

What to know

6 is read (4) + write (2); 4 is read alone. No one has execute permission, so the file cannot be run directly as a program, and only its owner can change it.

This is what a new file gets when your umask is 022, so most files you create on a typical Linux system are already 644. Web pages, stylesheets, images and most files under /etc are 644.

Where it fits

Gotchas

Related explainers

← chmod calculator