Change Permission Of A File In Linux

2 min read

Every file and directory in a Linux system carries a set of access rules that determine who can read, modify, or run it. Knowing how to change permission of a file in linux is a fundamental skill for system administrators, developers, and everyday users who want to secure their data or collaborate safely with others. Whether you are protecting a private script, sharing a document with a team, or troubleshooting a “permission denied” error, mastering Linux file permissions gives you precise control over your system.

Understanding Linux File Permissions

Linux treats every file as an object owned by a specific user and associated with a specific group. Permissions are divided into three categories: the owner, the group, and others. Each category can be granted three basic types of access: read, write, and execute.

The Three Permission Types

  • Read (r): Allows a user to view the contents of a file or list the contents of a directory.
  • Write (w): Allows a user to modify or delete a file, or create, rename, and delete files within a directory.
  • Execute (x): Allows a user to run a file as a program or script, or enter and access a directory.

The Three User Categories

  • Owner (u): The user who owns the file, usually the person who created it.
  • Group (g): A collection of users who share access rights to the file.
  • Others (o): Every other user on the system who is neither the owner nor a member of the group.

When you run the ls -l command, you see a string like this:

-rwxr-xr-- 1 john developers 4096 Jan 10 09:20 report.sh

The first character indicates the file type (- for a regular file, d for a directory). That's why the next nine characters represent permissions in three sets of three: owner, group, and others. In the example above, the owner can read, write, and execute; the group can read and execute; and others can only read Turns out it matters..

Honestly, this part trips people up more than it should.

How to Change Permission of a File in Linux Using chmod

The primary tool for modifying access rights is the chmod command, short for “change mode.” It supports two methods: symbolic mode and absolute (numeric) mode.

Symbolic Mode

Symbolic mode uses letters and symbols to add, remove, or set specific permissions without affecting others The details matter here..

The basic syntax is:

chmod [who][operator][permission] filename

  • Who: u (owner), g (group), o (others), a (all)
  • Operator: + (add), - (remove), = (set exactly)
  • Permission: r (read), w (write), x (execute)

Common examples:

  • chmod u+x script.sh — Grants the owner execute permission.
  • chmod go-w document.txt — Removes write permission for group and others.
  • chmod a+rw notes.txt — Gives everyone read and write access.
  • chmod u=rwx,g=rx,o=r backup.sh — Sets exact permissions for all categories.

Symbolic mode is ideal when you want to tweak one permission without rec

What's Just Landed

New This Month

Readers Also Loved

Stay a Little Longer

Thank you for reading about Change Permission Of A File In Linux. We hope the information has been useful. Feel free to contact us if you have any questions. See you next time — don't forget to bookmark!
⌂ Back to Home