div class='cap-left'/>

Geek Stuff (Linux) - Show Chmod Numerical Permissions

Thursday, December 3, 2015

During Linux installations of EPM, setting and validating the correct security on folders and files can be a challenge. The chmod command is used to set security access, while chown sets the ownership's. As you might now chmod has two modes of reading and applying security access: Symbolic and Octal mode.


Default is Symbolic mode, which is represented by a Reference, Operator and Mode. Octal mode simplifies the usage and is represented by three (digits) Numerical values.

Below a default output of an "ls -a" command in bash:


As you can see access rights is represented in symbolic mode (-rw-r-----). Sometime is it helpful to additionally show the octal representation. However the "ls" command and many others do not support this. Below a script that takes the "ls" command input and adds the numerical representation of the security.


Output of this script will look similar to (notice the 3 digits at the start of each row):


Enjoy this script!


sources:  https://en.wikipedia.org/wiki/Chmod

No comments :

Post a Comment