Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallTo change a file’s permissions in Linux, run chmod with either a numeric mode such as chmod 644 notes.txt or a symbolic change such as chmod u+x script.sh. Before you do, you need to understand what the permission string means, because a wrong mode can lock you out of your own files or expose them to other users. This guide explains the model, shows how to read and write both mode styles, and gives a safe routine for making changes.
How Linux permissions are organized
Every file and directory carries three sets of permission bits, one for each class of user:
As an Amazon Associate I earn from qualifying purchases.
- Owner (
u): the user who owns the file. - Group (
g): the users who belong to the file’s group. - Other (
o): everyone else on the system.
Each class can hold three bits: read (r), write (w), and execute (x). The meaning of each bit depends on whether the object is a file or a directory, and this is where most beginner confusion starts.
Recommended Free Tools
What the bits mean for files
- Read lets you read the file’s contents.
- Write lets you change the file’s contents.
- Execute lets you run the file as a program. A script without execute permission cannot be started directly, even if its text is perfectly valid.
What the bits mean for directories
- Read lets you list the names inside the directory.
- Write lets you create and remove entries in the directory.
- Execute does not mean “run.” On a directory it means search, or traverse: you can pass through it as part of a path and access entries whose names you already know. A directory with read but no execute lets you see names you cannot actually open.
The GNU Coreutils manual describes these directory meanings explicitly, and they are the reason a directory with r but without x is a confusing state to encounter.
#1 Best Overall
Reading a permission string
Running ls -l prints a line like this:
-rw-r--r-- 1 alice staff 2048 Oct 9 10:14 notes.txt
The first character is the file type: - for a regular file, d for a directory, and l for a symbolic link. The next nine characters are three triplets, read left to right as owner, group, and other. In -rw-r--r--, the owner can read and write, while the group and everyone else can only read.
For an exact view, stat prints the mode explicitly. On GNU systems, this command shows the octal value, the symbolic form, and the name in one line:
stat -c '%a %A %n' notes.txt
The output would look like 644 -rw-r--r-- notes.txt. The -c option with a format string is specific to GNU stat; BSD and macOS versions use different flags.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Numeric modes
Numeric modes use octal digits. Each permission has a value: read is 4, write is 2, and execute (or search, for directories) is 1. For each class, add the values of the bits you want. The three digits are owner, group, and other, in that order.
| Digit | Bits | Meaning |
|---|---|---|
| 7 | rwx | 4 + 2 + 1, read, write, and execute |
| 6 | rw- | 4 + 2, read and write |
| 5 | r-x | 4 + 1, read and execute |
| 4 | r– | 4, read only |
| 0 | — | No access |
Some common modes and what they produce:
| Command | Resulting string | Typical use |
|---|---|---|
chmod 644 notes.txt |
rw-r--r-- |
Ordinary documents readable by everyone |
chmod 755 script.sh |
rwxr-xr-x |
Scripts and programs others can run |
chmod 600 private.txt |
rw------- |
Files only the owner should read, such as private keys |
A numeric mode sets all nine bits at once. It does not keep whatever bits were there before, so chmod 644 on a file that was rwxrwxrwx leaves it at rw-r--r--. This is what makes numeric modes predictable, and also what makes them risky when you only meant to change one thing.
The numeric form can also take a fourth, leading digit for special bits: set-user-ID is 4, set-group-ID is 2, and the sticky bit is 1. These bits change how a program or directory behaves, not just who can read it. Leave them alone until you know you need them.
Symbolic modes
Symbolic modes read like a sentence: a class, an operator, and the permissions.
- Classes:
u(owner),g(group),o(other), ora(all three). - Operators:
+adds permissions,-removes them, and=sets exactly the listed permissions for those classes. - Permissions:
r,w, andx.
Examples:
chmod u+x script.shadds execute permission for the owner and leaves everything else alone.chmod go-w file.txtremoves write permission from the group and other.chmod a=r file.txtmakes the file read-only for all three classes, removing write and execute from everyone.
Symbolic modes suit small edits to an existing setup. If you omit the class letter, as in chmod +x script.sh, the process umask decides which classes are affected, so write u+x, a+x, or another explicit class when the result matters.
A safe routine for changing permissions
Work through these steps for any file where the change matters:
- Inspect the current mode. Run
ls -l filenameor thestatcommand above. - Decide who needs which access. Write the required access for owner, group, and other before typing anything.
- Apply the narrowest change. Prefer
u+xover755when you only need to make a script runnable by you. - Inspect again. Confirm the string matches what you intended. Run the program or open the file to test it.
Ownership and privilege
Only the file’s owner or a process with suitable privilege (such as root) can change its mode bits. If chmod returns Operation not permitted, you are not the owner, so check with ls -l and use sudo only if the change is actually intended for a system file.
Rank #4
Making a script executable
A script needs execute permission before you can start it directly. Add it for yourself, then run it by path:
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →chmod u+x backup.sh
./backup.sh
If you want everyone on the system to run it, use chmod a+x backup.sh, but only when the script is safe for every user to execute. If the shell reports Permission denied even after chmod succeeds, check that the filesystem was not mounted with the noexec option, which blocks running programs regardless of mode bits.
Recursive changes and symbolic links
chmod -R applies a change to a directory and everything beneath it. Use it only when every file in that tree should receive the same change. A recursive chmod 644 on a project directory, for example, will also strip execute permission from its subdirectories and any scripts inside, which breaks the directory’s traversal.
Best Value
Symbolic links need separate attention. On Linux, the permissions of a symbolic link itself are not meaningful: the system ignores them, and chmod acts on the file the link points to when you name the link directly. During a recursive run, GNU chmod ignores symbolic links it encounters by default. Following links during recursive operations can expose files outside the tree you meant to change, which is why the GNU manual warns about it.
Common mistakes
- Using
chmod 777as a fix. It gives read, write, and execute to owner, group, and other. Using it to get past an error hides the real cause and makes the file writable by any user. Determine which class needs which access instead. - Confusing directory execute with running. A directory with
xlets you traverse it, not run anything inside it. A directory withrand noxlets you see names you cannot open. - Assuming permissions explain every failure. Access can also be blocked by ownership, mount options such as
noexec, filesystem attributes, or system policy. If the mode looks correct and access still fails, check those next. - Treating special bits as defaults. Setuid, setgid, and the sticky bit have specific security effects. Do not add them to fix a permission error.
Choosing between numeric and symbolic modes
Use numeric modes when you know the complete pattern you want, such as 600 for a private file. Use symbolic modes when you want to change one aspect of an existing mode, such as adding execute for yourself with u+x, and leave the rest untouched. Symbolic modes are less likely to remove access you did not mean to remove.
Sources
The behavior described here follows the GNU Coreutils manual’s chmod invocation documentation, which states that chmod “changes the access permissions of the named files.” Specific flags for stat and recursive behavior vary between GNU, BSD, and macOS tools, so check your system’s man chmod and man stat pages when you work on a different platform.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




