Linux file permissions and chmod explained (755, 644)

Every file on Linux has three sets of permissions. chmod calculator converts between numbers and letters.

Steps

  1. Type permissions as 755 or rwxr-xr-x.
  2. Read who can read, write or run.
  3. Copy the chmod command.

Use cases

  • Setting up web server folders.
  • Fixing “permission denied” errors.
  • Reading ls -l output.

Tips

  • Read is 4, write is 2, execute is 1. Add them per class: 7 is rwx, 5 is r-x.
  • 644 for files and 755 for folders and scripts is a common safe default.
  • Avoid 777. It lets anyone change the file.

All guides

↑ ↓ navigateEnter openEsc close