Urgent.News

One page, thousands of outlets. See who else covered it.

Editions

Tech

Understanding chmod Without Memorizing Numbers

How Linux file permissions actually work under the hood, why symbolic mode is your best friend, and how to stop blindly typing chmod 777. Every Linux engineer has been there. You write a brand-new bash script, try to run it from your terminal, and hit an immediate roadblock: $ ./backup.sh bash: ./backup.sh: Permission denied You open your search engine or ask a chat assistant for help. Within…

Linux file permissions are a crucial aspect of managing a Linux system. Instead of blindly using a single number with chmod, understanding symbolic mode can simplify the process significantly. Let's explore how symbolic permission mode works and why it's preferable over numerical chmod methods.

When you run `ls -l`, you'll encounter a 10-character string at the beginning of each file/directory listing. This string represents the file's mode, which dictates who can read, write, or execute it. The mode is broken down into four parts: file type, owner permissions, group permissions, and permissions for others.

The first character indicates the file type (- for regular files, d for directories, l for symbolic links, etc.). The next nine characters are divided into three groups of three, representing the owner, group, and others. Each group contains three characters: 'r' for read, 'w' for write, and 'x' for execute. A dash (-) signifies no permission for that category.

Rather than memorizing three-digit codes, you can use symbolic mode to manage permissions more intuitively. The chmod command follows the format `chmod [WHO][ACTION][WHAT] filename`. You decide who to modify permissions for (user, group, others, or all), what action to perform (add, remove, or set), and what permission (read, write, or execute).

For example, to make a script executable for the owner without altering other permissions, you would use `chmod u+x deploy.sh`. This adds execute permission for the user while keeping everything else unchanged. Understanding symbolic mode allows you to manage permissions effectively without relying on rote memorization of numbers.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Your Database Is Making 4 Promises. Here's What ACID Means.

Introduction Your program keeps opening transactions. A signup writes a new user row. A checkout debits one account and credits another. A form submission updates three related tables at once.

  • Atomicity ensures all parts of a transaction happen together as one unit
  • If any part fails, the entire transaction is rolled back to maintain consistency
  • ACID guarantees Atomicity, Consistency, Isolation, and Durability for transactions

Block Scope in JavaScript

Block scope is an important concept in JavaScript. It means that a variable can be accessed only inside the block where it is declared. A block is usually written using curly braces { } .

How Python Takes Out Its Own Garbage

Python manages memory automatically, freeing developers from manual allocation and deallocation. It does this through two complementary mechanisms: reference counting and a generational garbage…

More from Monday 17 August →