.keep file

From Gentoo Wiki
Jump to:navigation Jump to:search

In Gentoo, files with the name .keep (and files with the ".keep-" prefix) are found in some directories. They should not be deleted.

These directories are necessary, but often empty, especially at their creation time. Unmerge deletes empty directories, and ".keep" files make sure these directories will be kept to remain.

More specifically, there are two variants: The files with the name .keep are created by catalyst.

Packages can create ".keep" files, too. In this case they will be named


  • /var/log/portage/elog/.keep_sys-apps_portage-0

(Packages have the default slot number "0".)

Packages create ".keep" files by the ebuild helper function "keepdir". See the description by:

user $man 5 ebuild