> For the complete documentation index, see [llms.txt](https://www.shellspells.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.shellspells.net/linux/system-ops/services/enumerate.md).

# Enumerate

## <mark style="color:red;">All Systems</mark>

<table data-header-hidden data-full-width="true"><thead><tr><th width="454">Command</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:yellow;"><code>cat /etc/services</code></mark></td><td>Display network services</td></tr><tr><td><mark style="color:yellow;"><code>service --status-all</code></mark></td><td>Shows all services</td></tr><tr><td><mark style="color:yellow;"><code>ps aux | grep [service_name]</code></mark></td><td>Lists processes related to a specific service.</td></tr><tr><td><mark style="color:yellow;"><code>netstat -tlpn | grep [service_name]</code></mark></td><td>Shows network connections used by a service.</td></tr><tr><td><mark style="color:yellow;"><code>ss -tulnp</code></mark></td><td>Another command to display active network connections and associated services</td></tr></tbody></table>

## <mark style="color:red;">Systemd (most modern distributions):</mark>

<table data-header-hidden data-full-width="true"><thead><tr><th width="454">Command</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:yellow;"><code>systemctl</code></mark></td><td>Lists units for systemd, implicitly including services.</td></tr><tr><td><mark style="color:yellow;"><code>systemctl list-unit-files</code></mark></td><td>Lists all available systemd unit files, including services.</td></tr><tr><td><mark style="color:yellow;"><code>systemctl list-units</code></mark></td><td>Shows currently running services and their status.</td></tr><tr><td><mark style="color:yellow;"><code>systemctl list-units --type=service --all</code></mark></td><td>Lists all systemd services, including active and inactive.</td></tr><tr><td><mark style="color:yellow;"><code>systemctl status [service_name]</code></mark></td><td>Displays detailed information about a specific service.</td></tr><tr><td><mark style="color:yellow;"><code>systemctl enable/disable [service_name]</code></mark></td><td>Enables or disables a service for automatic startup.</td></tr></tbody></table>

## <mark style="color:red;">SysV init (older distributions):</mark>

<table data-header-hidden data-full-width="true"><thead><tr><th width="458">Command</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:yellow;"><code>/etc/init.d</code></mark></td><td>Directory containing service scripts.</td></tr><tr><td><mark style="color:yellow;"><code>ls /etc/init.d</code></mark></td><td>Lists all service scripts in the directory.</td></tr><tr><td><mark style="color:yellow;"><code>service --status-all</code></mark></td><td>Displays the status of all services.</td></tr><tr><td><mark style="color:yellow;"><code>service [service_name] status</code></mark></td><td>Checks the status of a specific service.</td></tr><tr><td><mark style="color:yellow;"><code>service [service_name] start/stop/restart</code></mark></td><td>Starts, stops, or restarts a service.</td></tr><tr><td><mark style="color:yellow;"><code>chkconfig --list</code></mark></td><td>Lists all services and their runlevel settings.</td></tr></tbody></table>

## <mark style="color:red;">Upstart (rarely used now):</mark>

<table data-header-hidden data-full-width="true"><thead><tr><th width="459">Command</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:yellow;"><code>status [service_name]</code></mark></td><td>Shows the status of a specific service.</td></tr><tr><td><mark style="color:yellow;"><code>stop [service_name]</code></mark></td><td>Stops a service.</td></tr><tr><td><mark style="color:yellow;"><code>start [service_name]</code></mark></td><td>Starts a service.</td></tr><tr><td><mark style="color:yellow;"><code>initctl list</code></mark></td><td>Lists all running Upstart jobs.</td></tr></tbody></table>
