This cheatsheet provides common Linux commands for managing file permissions, changing ownership, and configuring sudoers. It is designed for DevOps professionals managing Linux systems.
chmod 755 filename
chown user:group filename
chown -R user:group /path/to/directory
ls -l filename
usermod -aG sudo username
Use visudo for safe editing.
visudo
grep '^sudo' /etc/group
Example: set default for directories and files
find /path/to/directory -type d -exec chmod 755 {} \;
find /path/to/directory -type f -exec chmod 644 {} \;
find / -perm 644
ls -lR /path/to/directory | less