stat displays information about a file or directory The information includes metadata like size, permissions, timestampts etc Size → size in Bytes Blocks → Total blocks allocated on the HDD IO Block → size of each bloc in Bytes Device → in hexadecimal format Inode → inode of the file Links → amount of hard links Access → file permissions Uid → owner ID Gid → group ID Then there are timestamps for Access, modify, change and birth stat file.txt → shows information for a file stat -f ~/CLI/ → shows information for a directory
b - inodes
inodes are unique identifiers for files and directories They represent the smallest unit of storage and are stored as block Each inode contains metadata information such as permissions, timestamp type etc It is assigned a unique number when a file is created It remains the same through the file's lifetime inodes are used to track files and directories on a disk stat -c %i file.txt → shows the file's inode number