Linux command
lxc-destroy 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Delete
sudo lxc-destroy -n [container_name]
Force delete
sudo lxc-destroy -n [container_name] -f
Delete container and all its snapshots
sudo lxc-destroy -n [container_name] -s
Example
lxc-destroy --help
说明
lxc-destroy deletes a Linux container and its configuration. The container must be stopped before destruction unless -f is used.
参数
- -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.
FAQ
What is the lxc-destroy command used for?
lxc-destroy deletes a Linux container and its configuration. The container must be stopped before destruction unless -f is used.
How do I run a basic lxc-destroy example?
Run `sudo lxc-destroy -n [container_name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -n, --name _NAME_ do in lxc-destroy?
Container name to destroy.