Work out octal permission converter instantly with clear inputs, formula shown and shareable results.
Symbolic and octal notation describe the same nine permission bits. Each class of three characters maps to one octal digit by summing 4 for r, 2 for w and 1 for x, so rw-r--r-- is 644. Converting in both directions is a routine part of reading ls output against chmod arguments.
Conversion
per class: r = 4, w = 2, x = 1, summed; reverse by decomposing each octal digit into those three bits
The first character is the file type — d for directory, l for symlink, - for regular file — and it is not part of the nine permission bits.
Those indicate setuid, setgid or the sticky bit, which occupy a fourth leading octal digit rather than the standard three.