Rhel/Centos: by Shashank Gosavi
Rhel/Centos: by Shashank Gosavi
By Shashank Gosavi
Introduction
Red Hat Enterprise Linux is the Linux distro for enterprise environment, developed by Red Hat Inc. Due to support of Red Hat Network (RHN), it is widely used for servers. Community Enterprise OS (CentOS) is based on source code of RHEL and freely available. But do not have RHN support.
INODE
Index Node ? INODE is metadata. It stores following info
It is simple Directory name to INODE number mapping. INODE no of .(DOT) is INODE no of Current Directory
Blocks
Whenever a partition is formatted with a file system. It normally gets formatted with a default block size. Now block size is the size of chunks in which data will be spread. So if the block size is 4K, then for a file of 15K it will take 4 blocks(because 4K*4 16), and technically speaking you waste 1 K.
INODE (cont.)
INODE in Commands ls -i <filename> stat <filename> find -inum <number> <command> ; cd $(find inum <number>) Effects of cp and mv commands.
UMASK
User file-creation mode mask Determines the file permission for newly created files. Also control the default file permission for new files To set umask open /etc/profile and append umask 022 (or any valid umask value) To set umask open ~/.bashrc and append umask 022 (or any valid umask value)
Calculating UMASK
Octal Value 0 Permission Read, Write, Execute
1
2
Read, Write
Read, Execute
3
4 5 6 7
Read only
Write, Execute Write Only Execute only No Permissions
Examples
If umask is set to 022,then permissions are calculated as:
Bit Targeted At File Permission
0
2 2
Owner
Group Others
THANK YOU