How to Use chmod 644 in Linux

Learn what chmod 644 means and why it is common for ordinary files.

644 is a common mode for non-executable files: rw- for the owner and r-- for group and others.

Step by step

1 Set 644

$ chmod 644 config.txt

Sets the mode to rw-r--r--.

2 Verify

$ ls -l config.txt

Check the symbolic permissions.

3 Protect a secret

$ chmod 600 .env

600 gives the owner read/write and nobody else access.

Tips worth knowing

Frequently asked questions

What does chmod 644 mean?

Owner has read/write; group and others have read.

What is the difference between 644 and 755?

644 is rw-r--r--; 755 is rwxr-xr-x.

If it goes wrong

Permission denied

The path resolves fine — the system simply will not let you do that with it.

The commands behind it

chmod

Change file permissions with numeric (755, 644) and symbolic (u+x) modes — clearly explained.

ls

List the contents of a directory, with options for hidden files, long format, sorting and more.

chown

Assign files to users and groups — the other half of Linux permissions.

Concepts involved: File permissions

More how-to guides

Check disk space in Linux

See how much space is left, and find out what is using it.

Extract a .tar.gz archive

Unpack tar.gz, tar.bz2, tar.xz and zip archives from the command line.

Free a port that is already in use

Find which process holds a port and stop it cleanly.

Find and replace text in files

Replace text in one file or across a whole project, safely.