Linux File Permissions Game
Linux File Permissions Cheat Sheet
- Change file permissions:
chmod 755 filename
- Make file executable:
chmod +x filename
- Remove write permission for others:
chmod o-w filename
- Set specific owner and group:
chown user:group filename
- Check file permissions:
ls -l filename
- Make a directory only accessible by the owner:
chmod 700 dirname
- Give group ownership to 'staff':
chown :staff filename
- Set a file to read-only for all users:
chmod 444 filename
- Make all shell scripts in a folder executable:
chmod +x *.sh
- Copy permissions from another file:
chmod --reference=example.txt file.txt