Skip to main content

File Permissions

Linux uses permissions to control who can read, write, or execute a file.

SymbolMeaning
rRead (view file content)
wWrite (edit file content)
xExecute (run as a program/script)
CommandDescription
ls -lShow file permissions
chmod 755 fileChange permissions (numbers)
chmod u+x fileGive user execute permission
chown user fileChange file owner

Example:

ls -l

Output:

-rw-r--r-- 1 owner group  1000 file.txt
chmod 644 document.txt

Permission Number Reference

PermissionNumber
r--4
-w-2
--x1

Example:

chmod 755 script.sh

Means:

  • owner: 7 → rwx
  • group: 5 → r-x
  • others: 5 → r-x