How many bits on a linux file system is taken up for the permissions of a file?
To add to the other answers:
Traditional Unix permissions are broken down into:
Each of those is stored as a bit, where 1 means permitted and 0 means not permitted.
For example, read only access, typically written
There are 3 sets of those permissions, which determines the allowed access for:
They are all stored together in the same variable, e.g.
So that makes 9 bits.
Then, there are 3 other special bits:
And finally, the file's type is stored using 4 bits, e.g. whether it is a regular file, or a directory, or a pipe, or a device, or whatever.
These are all stored together in the inode, and together it makes 16 bits.
Which permissions? Basic permissions fit in 16 bits; ext2 uses 32 bits, plus another 32 bits for file flags (
Information about files are stored in a data structure called an inode. There is a field in this structure for the mode, which contains the permissions. This field on my system is an unsigned short which is 2 bytes and 16 bits.
Take a look at fs.h in the Linux source to see for yourself.