How to calculate
For each class, add four for read, two for write, and one for execute. A leading optional digit adds setuid, setgid, or sticky. Lowercase s or t includes execute, while uppercase S or T leaves execute off.
Worked example
Use Convert Octal mode to permissions · Octal mode 755. The result is 755.
Input and result notes
The example applies only to a single file named file. Symbolic ls strings may include the initial file-type character. Access control lists and platform rules can also affect access.
GNU Coreutils numeric file modes