LinuxCommandLibrary

ctop

Monitor container resource usage

TLDR

Show only [a]ctive containers

$ ctop -a
copy

[r]everse the container sort order
$ ctop -r
copy

[i]nvert the default colors
$ ctop -i
copy

Display [h]elp
$ ctop -h
copy

SYNOPSIS

ctop [OPTIONS]

PARAMETERS

--docker-host
    Specifies the Docker daemon host to connect to.

--filter
    Filters containers by name, status, or ID using a regular expression.

--refresh
    Sets the refresh rate of the display in seconds (default: 1).

--sort
    Sets the initial sort column (e.g., 'cpu', 'mem', 'name').

--follow
    Follows a specific container, showing only its details.

--hide-exited
    Hides exited containers from the main view.

--hide-exited-duration
    Hides exited containers older than the specified duration (e.g., '1h', '30m').

--disable-host-info
    Disables the display of host-level information in the header.

--disable-update-check
    Disables the automatic check for new ctop updates.

DESCRIPTION

ctop is an interactive command-line utility designed for real-time monitoring of Docker and Podman containers. It provides a familiar top-like interface, displaying essential metrics such as CPU usage, memory consumption, network I/O, block I/O, and process IDs (PIDs) for all running containers.

Users can sort containers by various metrics (e.g., CPU, memory), filter the displayed list by name or status, and view detailed information for individual containers. Its ncurses-based interface allows for intuitive navigation and interaction directly within the terminal, making it an indispensable tool for developers and system administrators to quickly identify resource bottlenecks, troubleshoot issues, or simply keep an eye on their containerized applications.

CAVEATS

ctop requires either the Docker or Podman daemon to be running and accessible on the host where it is executed.
Depending on your system's configuration and security policies, you might need elevated privileges (e.g., being part of the 'docker' group or using sudo) to access container statistics via the daemon's API.
It is not typically pre-installed on most Linux distributions and usually requires a manual installation process.

<B>INTERACTIVE KEYBINDINGS</B>

ctop offers a rich set of keybindings for interactive management and navigation within the terminal interface:
s: Sort containers by the currently selected column (e.g., CPU, Memory, Name)
f: Apply or clear filters to narrow down the displayed containers
d: Display detailed information for the currently selected container
l: View real-time logs for the selected container
k: Kill the selected container
p: Pause or unpause the selected container
r: Restart the selected container
e: Execute a command within the selected container (drops you into its shell)
q or Ctrl+C: Quit ctop and exit the application

HISTORY

ctop was developed by Brandon Cicen (bcicen) and first released around 2017. It quickly gained traction as a more user-friendly and interactive alternative to traditional container monitoring commands like docker stats, providing a comprehensive real-time overview of container performance in a familiar top-like interface. It continues to be an actively maintained open-source project on GitHub, with ongoing development and community contributions.

SEE ALSO

top(1), htop(1), docker(1), docker-stats(1), podman(1)

Copied to clipboard