Ubuntu Server CLI Cheat Sheet 2024 v6
Ubuntu Server CLI Cheat Sheet 2024 v6
Ubuntu Server CLI Cheat Sheet 2024 v6
1 of 3
System Files
Packages Networking
LXD is a modern, secure and powerful tool that provides a unified experience for Ubuntu Pro delivers 10 years of expanded security coverage on top of Ubuntu’s Long Term
running and managing containers or virtual machines. Visit https ://canonical.com/lxd Support (LTS) commitment in addition to management and compliance tooling.
for more information. Visit https://ubuntu.com/pro to register for free on up to five machines.
lxd init : initializes LXD before first use Activating Ubuntu Pro
sudo pro attach <token> : Attaches your machine to Ubuntu Pro using a specific
Creating instances token. This token is provided when you subscribe to Ubuntu Pro.
lxc init ubuntu:22.04 <container name> : Creates a lxc system container (without
starting it). Managing services
lxc launch ubuntu:24.04 <container name> : Creates and starts a lxc system sudo pro status : Displays the status of all Ubuntu Pro services.
container. sudo pro enable <service> : Enables a specific Ubuntu Pro service, like ESM, FIPS,
lxc launch ubuntu:22.04 <vm name> --vm : Creates and starts a virtual machine. or Livepatch.
sudo pro disable <service> : Disables a specific Ubuntu Pro service.
Managing instances
lxc list : Lists instances. Extended Security Maintenance (ESM)
lxc info <instance> : Shows status information about an instance. sudo pro enable esm-infra : Activates Extended Security Maintenance for infrastructure
lxc start <instance> : Starts an instance. packages, providing security updates beyond the standard release cycle.
lxc stop <instance> [--force] : Stops an instance. sudo pro enable esm-apps : Activates ESM for applications, extending security
lxc delete <instance> [--force|--interactive] : Deletes an instance. coverage for specific applications.