LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

lxc-destroy

Delete a Linux container and its configuration

TLDR

Delete a stopped container
$ sudo lxc-destroy -n [container_name]
copy
Force delete a running container (stops it first)
$ sudo lxc-destroy -n [container_name] -f
copy
Delete container and all its snapshots
$ sudo lxc-destroy -n [container_name] -s
copy
Display help
$ lxc-destroy --help
copy

SYNOPSIS

lxc-destroy -n name [options]

DESCRIPTION

lxc-destroy deletes a Linux container and its configuration. The container must be stopped before destruction unless -f is used.

PARAMETERS

-n, --name NAME

Container name to destroy.
-P, --lxcpath PATH
Use an alternate container storage directory.
-f, --force
Force destruction of a running container (stops it first).
-s, --snapshots
Also destroy all snapshots of the container.
-l, --logpriority LEVEL
Set log priority (FATAL, CRIT, WARN, ERROR, NOTICE, INFO, DEBUG).
-o, --logfile FILE
Output to alternate log file.
-?, --help
Display help information.

CAVEATS

Requires root privileges. Permanently deletes container and its root filesystem. Stop container first unless using --force.

SEE ALSO

Copied to clipboard
Kai