Bird
Raised Fist0
Linux CLIscripting~10 mins

Numeric permission mode (755, 644) in Linux CLI - Step-by-Step Execution

Choose your learning style10 modes available
Concept Flow - Numeric permission mode (755, 644)
Start with numeric mode
↓
Split digits: Owner, Group, Others
↓
Convert each digit to rwx
↓
Apply permissions to file/folder
↓
Check permissions with ls -l
↓
End
This flow shows how numeric permission modes like 755 or 644 are split into owner, group, and others, then converted to read/write/execute permissions and applied to files.
Execution Sample
Linux CLI
chmod 755 file.txt
ls -l file.txt
Set file.txt permissions to 755 and then list its permissions.
Execution Table
StepActionInput Numeric ModeOwner PermissionGroup PermissionOthers PermissionResulting rwxCommand Output
1Start755
2Split digits755755
3Convert 7 to rwx7rwx
4Convert 5 to r-x5r-x
5Convert 5 to r-x5r-x
6Apply chmod755rwxr-xr-xrwxr-xr-x
7Check permissions-rwxr-xr-x 1 user group 0 date file.txt
8Start644
9Split digits644644
10Convert 6 to rw-6rw-
11Convert 4 to r--4r--
12Convert 4 to r--4r--
13Apply chmod644rw-r--r--rw-r--r--
14Check permissions-rw-r--r-- 1 user group 0 date file.txt
15End
💡 Execution stops after permissions are applied and verified with ls -l.
Variable Tracker
VariableStartAfter Step 2After Step 3/4/5After Step 6Final
Numeric Mode755755755755
Owner Digit7777
Group Digit5555
Others Digit5555
Owner rwxrwxrwxrwx
Group rwxr-xr-xr-x
Others rwxr-xr-xr-x
Permission Stringrwxr-xr-xrwxr-xr-x
Key Moments - 3 Insights
Why does the digit 7 translate to rwx?
Because 7 in binary is 111, which means read (4) + write (2) + execute (1) permissions are all set, as shown in execution_table rows 3 and 6.
Why does 5 translate to r-x and not rwx?
5 in binary is 101, meaning read (4) and execute (1) are set, but write (2) is not, as shown in execution_table rows 4, 5, and 6.
What does the permission string rw-r--r-- mean for 644?
It means owner can read and write, group and others can only read, matching digits 6 (rw-), 4 (r--), and 4 (r--) in execution_table rows 10-13.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table at step 3, what permissions does the owner get for digit 7?
Arwx
Brw-
Cr-x
Dr--
💡 Hint
Check the 'Owner rwx' column at step 3 in execution_table.
At which step does the group permission get converted for mode 755?
AStep 3
BStep 4
CStep 5
DStep 6
💡 Hint
Look at the 'Group Permission' and 'Resulting rwx' columns in execution_table.
If the numeric mode changed from 644 to 600, what would be the others permission?
Ar--
Brw-
C---
Drwx
💡 Hint
Refer to how digit '4' maps to 'r--' and '0' maps to '---' in execution_table rows 11-12.
Concept Snapshot
Numeric permission mode uses three digits: owner, group, others.
Each digit is a sum of read(4), write(2), execute(1).
Example: 7 = rwx (4+2+1), 5 = r-x (4+0+1), 4 = r-- (4+0+0).
Use chmod <mode> <file> to apply.
Check with ls -l to see permissions.
Full Transcript
Numeric permission modes like 755 or 644 are three-digit numbers representing file permissions for owner, group, and others. Each digit is a sum of read (4), write (2), and execute (1) permissions. For example, 7 means read, write, and execute are all allowed. The process starts by splitting the numeric mode into three digits, converting each digit to its rwx form, applying these permissions to the file using chmod, and then verifying with ls -l. This visual execution shows step-by-step how digits 7, 5, and 4 translate to rwx, r-x, and r-- respectively, and how the final permission string looks. Understanding this helps control who can read, write, or execute files on Linux systems.

Practice

(1/5)
1. What does the numeric permission mode 755 mean for a file in Linux?
easy
A. User can read, write, execute; group and others can read and execute
B. User can read and write; group and others can only read
C. User, group, and others can read, write, and execute
D. User can read and execute; group and others have no permissions

Solution

  1. Step 1: Understand numeric permission digits

    Each digit represents permissions for user, group, and others respectively. 7 means read(4)+write(2)+execute(1)=7, 5 means read(4)+execute(1)=5.
  2. Step 2: Decode 755

    User (7) has read, write, execute; group (5) and others (5) have read and execute only.
  3. Final Answer:

    User can read, write, execute; group and others can read and execute -> Option A
  4. Quick Check:

    755 = rwx r-x r-x [OK]
Hint: 7 means full rights; 5 means read+execute only [OK]
Common Mistakes:
  • Confusing 5 with write permission
  • Thinking 7 means read+write only
  • Mixing group and others permissions
2. Which of the following is the correct command to set a file named script.sh to permission mode 755?
easy
A. chmod 644 script.sh
B. chmod 700 script.sh
C. chmod 777 script.sh
D. chmod 755 script.sh

Solution

  1. Step 1: Identify the command to change permissions

    The command to change file permissions is chmod followed by the numeric mode and filename.
  2. Step 2: Match the mode 755 with the command

    To set mode 755, use chmod 755 script.sh.
  3. Final Answer:

    chmod 755 script.sh -> Option D
  4. Quick Check:

    chmod + numeric mode + filename = chmod 755 script.sh [OK]
Hint: chmod + mode + filename sets permissions [OK]
Common Mistakes:
  • Using wrong numeric mode
  • Swapping filename and mode
  • Using chmod without mode
3. If a file has permissions set to 644, what will be the output of ls -l filename showing the permission part?
medium
A. -rw-r--r--
B. -rwxrwxrwx
C. -rwxr-xr-x
D. -rw-rw-r--

Solution

  1. Step 1: Decode numeric mode 644

    6 = read(4)+write(2), 4 = read only, so user has read/write, group and others have read only.
  2. Step 2: Translate to symbolic permissions

    Permissions are -rw-r--r-- where '-' means regular file, 'rw-' user, 'r--' group, 'r--' others.
  3. Final Answer:

    -rw-r--r-- -> Option A
  4. Quick Check:

    644 = rw- r-- r-- [OK]
Hint: 6 = rw-, 4 = r-- in permissions [OK]
Common Mistakes:
  • Confusing 4 with execute permission
  • Mixing user and group permissions
  • Assuming 644 includes execute
4. You ran chmod 755 myfile but ls -l myfile shows -rw-r--r--. What is the likely problem?
medium
A. The chmod command syntax is incorrect
B. You forgot to specify the filename
C. You do not have permission to change the file mode
D. The file is a directory, not a regular file

Solution

  1. Step 1: Understand chmod effect and output

    chmod 755 should set execute permission, but output shows no execute bits.
  2. Step 2: Identify permission issue

    If permissions did not change, likely user lacks rights to modify file mode (not owner or no sudo).
  3. Final Answer:

    You do not have permission to change the file mode -> Option C
  4. Quick Check:

    chmod no effect = permission denied [OK]
Hint: No change after chmod? Check your ownership rights [OK]
Common Mistakes:
  • Assuming syntax error
  • Thinking file type blocks chmod
  • Ignoring user permissions
5. You want to make a script file executable only by the owner and readable by everyone else. Which numeric mode should you use?
hard
A. 644
B. 744
C. 700
D. 755

Solution

  1. Step 1: Define required permissions

    Owner: executable + read + write (7), group and others: read only (4 each).
  2. Step 2: Construct numeric mode

    Owner = 7 (rwx), group = 4 (r--), others = 4 (r--), so mode is 744.
  3. Final Answer:

    744 -> Option B
  4. Quick Check:

    744 = rwx r-- r-- [OK]
Hint: Owner full, others read only = 744 [OK]
Common Mistakes:
  • Choosing 755 which allows execute for others
  • Using 700 which denies read for others
  • Confusing 644 with execute permission
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard