Octal vs symbolic notation
Each permission class, owner, group, and other, holds three bits: read (4), write (2), and execute (1). Adding the bits that apply gives a single digit from 0 to 7, so rwx is 4+2+1 = 7 and r-x is 4+0+1 = 5. chmod 755 file and chmod u=rwx,g=rx,o=rx file set the exact same bits; octal is shorter to type, symbolic is easier to read when only one class needs to change.
Special permission bits
setuid, setgid, and the sticky bit occupy their own digit, placed before the owner/group/other digits and built from the same 4/2/1 weights. In symbolic form they replace the execute character: a lowercase s or t means the bit is set and the file is also executable for that class, while an uppercase S or T means the bit is set but execute is not. chmod 4755 file sets setuid on top of 755, shown as rwsr-xr-x.
Directory execute bit
On a directory, the execute bit means something different from a regular file: it controls whether a process can cd into the directory or access files inside it by name, not whether the directory itself can “run.” A directory with r-- but no execute bit lets a user list file names but not open any of them.
Common permission sets
755 is the default for directories and executable scripts: the owner can modify them, everyone else can read and execute. 644 is the default for static files that should never run as a program. 600 restricts a file to the owner entirely, which is the expected mode for SSH private keys and other credentials.