My question may seem really basic but I struggled to find satisfactory answer. I have started to wonder what is the exact structure of a file in Linux. There are some commands like file or ls that can be used to get some information about the file but I would like to check values of all attributes that file is comprised of. I mean each file has its creator, different important dates, modes, type, encoding, size, actual data etc. Address that informs where the file is located on the hard drive also got to be stored somewhere. Are all of these information stored in the header of the file, ahead actual data or are they in different memory locations? Is there any magic way to get all possible information about the file using bash?

  • There's no "magic" way. But there are commands such as stat(1) to help obtain some of it. – roaima Jan 4 '16 at 16:33

If file/ls is not enough for you, then use stat (man stat).

Not the answer you're looking for? Browse other questions tagged or ask your own question.