Appearance
File Permissions
bash
# View permissions
ls -la
# Output looks like:
# -rw-r--r-- 1 fabiocorrea staff 1234 Jan 1 12:00 file.txt
# drwxr-xr-x 5 fabiocorrea staff 160 Jan 1 12:00 folder/| Symbol | Meaning |
|---|---|
r | Read |
w | Write |
x | Execute |
d | Directory |
- | Not set |
Changing Permissions
bash
# Make a script executable
chmod +x script.sh
# Make a file read-only
chmod 444 file.txt