Problem Statement
What does the command 'chmod 755 file.sh' do?
Explanation
Chmod 755 breaks down as 7 (owner), 5 (group), and 5 (others). Each digit is the sum of permissions: read=4, write=2, execute=1. So 7=4+2+1 (rwx for owner), 5=4+1 (r-x for group), and 5=4+1 (r-x for others). This is a common permission set for scripts and executables.
The owner can read, modify, and execute the file, while group members and other users can read and execute but cannot modify it. This permission scheme is typical for shell scripts that need to be executable but shouldn't be modified by non-owners.
Understanding octal notation is essential for Linux administration. Other common permissions include 644 (rw-r--r--) for regular files, 600 (rw-------) for sensitive files like private keys, and 777 (rwxrwxrwx) for fully open files though this is generally insecure and discouraged.
