In Linux, which command provides detailed metadata about a file (size, inode, timestamps, etc.)?

Enhance your cyber defense skills with the Security Blue Team Level 1 Test. Prepare with flashcards, multiple choice questions, and detailed explanations to ace your exam!

Multiple Choice

In Linux, which command provides detailed metadata about a file (size, inode, timestamps, etc.)?

Explanation:
Stat provides the full set of filesystem metadata for a file. It reads the kernel’s inode information and prints details such as the size in bytes (st_size), the inode number (st_ino), the file type and permissions (st_mode), the number of hard links (st_nlink), ownership (st_uid and st_gid), and the timestamps (st_atime, st_mtime, st_ctime). Some filesystems also expose a birth time. Running stat on a file returns this comprehensive metadata directly from the filesystem, and you can format the output as needed with options. Other approaches only cover subsets or different kinds of metadata: a long directory listing shows human-friendly attributes but not the full inode and timestamp set, tools that read embedded file metadata (like EXIF) fetch data inside the file rather than filesystem metadata, and hashing tools compute content fingerprints rather than metadata.

Stat provides the full set of filesystem metadata for a file. It reads the kernel’s inode information and prints details such as the size in bytes (st_size), the inode number (st_ino), the file type and permissions (st_mode), the number of hard links (st_nlink), ownership (st_uid and st_gid), and the timestamps (st_atime, st_mtime, st_ctime). Some filesystems also expose a birth time. Running stat on a file returns this comprehensive metadata directly from the filesystem, and you can format the output as needed with options.

Other approaches only cover subsets or different kinds of metadata: a long directory listing shows human-friendly attributes but not the full inode and timestamp set, tools that read embedded file metadata (like EXIF) fetch data inside the file rather than filesystem metadata, and hashing tools compute content fingerprints rather than metadata.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy