Ad space (banner)
🖥️Linux Lessons
Lesson 15 / 61

Changing File Permissions with chmod

chmod is for when "I want to let other people execute this file." chmod stands for change mode, and it changes a file or folder's access permissions (read, write, execute).

Use it in the form chmod number filename. The number represents owner/group/others permissions as 3 digits — 755 means the owner gets full permission, and everyone else gets read and execute only.

Running chmod 755 app.js makes app.js executable, so a shell script or similar can be run directly as a command.

A common early mistake is opening things up too far, like chmod 777, letting anyone write and execute — creating a real security risk. Stick to the minimum permission needed.

In real work, this is used in security-critical spots — granting execute permission to a deployment script, restricting a private key file's permission down to 600, and more.

Linux
Try it (type this into the pseudo terminal)
chmod 755 app.js

🧑‍💻 You can type this command into the Linux pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)