Skip to content

Latest commit

 

History

History
20 lines (12 loc) · 763 Bytes

sparse-files.md

File metadata and controls

20 lines (12 loc) · 763 Bytes

Sparse Files

A sparse file is a type of file that attempts to use file system space more efficiently when the file itself is partially empty.

This is done by writing metadata representing the empty blocks to disk instead of the actual "empty" space which makes up the block, using less disk space.

The full block size is written to disk as the actual size only when the block contains "real" (non-empty) data.

The /var/log/lastlog is a typical example of a very sparse file.

Detection

The -s option of the ls command shows the occupied space in blocks.

$ ls -lhs

More Reading