File Permissions
In this page:
File Permissions
File permissions control read (r), write (w), and execute (x) access for the owner, group, and others, viewable with ls -l. chmod changes them, either symbolically (chmod u+x file) or numerically (chmod 755 file). Understanding the numeric mode (owner/group/other as three digits) is essential for managing script and file access.
Note: chmod 755 is the common mode for an executable script: owner can read/write/execute, everyone else can read/execute.
Example: File Permissions
#!/bin/bash
touch demo.sh
chmod 755 demo.sh
ls -l demo.sh
chmod u-x demo.sh
ls -l demo.sh
Login to try C/C++/Java/PHP code in the editor
🔒
Chapter Quiz — Complete all 13 topics to unlock
0/13 topics done
Complete these topics first: