---
name: "services_mkdb"
section: "8"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/services_mkdb"
---

# services\_mkdb(8)

generate the services database

## NAME

**services\_mkdb** – generate the services database

## SYNOPSIS

**services\_mkdb** \[**-b** \| **-l**\] \[**-q**\] \[**-o** *database*\] \[*file*\]

**services\_mkdb** **-u** \[*file*\]

## DESCRIPTION

The **services\_mkdb** utility creates a [db(3)](/db/3.md) database for the specified *file*. If no file is specified, then */etc/services* is used. The database is installed into */var/db/services.db*. The file must be in the correct format (see [services(5)](/services/5.md)).

The options are as follows:

- **-b**

  Use big-endian byte order for database metadata.

- **-l**

  Use little-endian byte order for database metadata.

- **-o** *database*

  Put the output databases in the named file.

- **-q**

  Do not warn about duplicate services.

- **-u**

  Print the services file to stdout, omitting duplicate entries and comments.

The databases are used by the C library services routines (see [getservent(3)](/getservent/3.md)).

The **-b** and **-l** flags are mutually exclusive. The default byte ordering is the current host order.

## FILES

- */var/db/services.db*

  The current services database.

- */var/db/services.db.tmp*

  A temporary file.

- */etc/services*

  The current services file.

## EXIT STATUS

The **services\_mkdb** utility exits 0 on success, and \>0 if an error occurs.

## SEE ALSO

[db(3)](/db/3.md), [getservent(3)](/getservent/3.md), [services(5)](/services/5.md)

## BUGS

Because **services\_mkdb** guarantees not to install a partial destination file it must build a temporary file in the same file system and if successful use [rename(2)](/rename/2.md) to install over the destination file.

If **services\_mkdb** fails it will leave the previous version of the destination file intact.
