Enumerate

All Systems

cat /etc/services

Display network services

service --status-all

Shows all services

ps aux | grep [service_name]

Lists processes related to a specific service.

netstat -tlpn | grep [service_name]

Shows network connections used by a service.

ss -tulnp

Another command to display active network connections and associated services

Systemd (most modern distributions):

systemctl

Lists units for systemd, implicitly including services.

systemctl list-unit-files

Lists all available systemd unit files, including services.

systemctl list-units

Shows currently running services and their status.

systemctl list-units --type=service --all

Lists all systemd services, including active and inactive.

systemctl status [service_name]

Displays detailed information about a specific service.

systemctl enable/disable [service_name]

Enables or disables a service for automatic startup.

SysV init (older distributions):

/etc/init.d

Directory containing service scripts.

ls /etc/init.d

Lists all service scripts in the directory.

service --status-all

Displays the status of all services.

service [service_name] status

Checks the status of a specific service.

service [service_name] start/stop/restart

Starts, stops, or restarts a service.

chkconfig --list

Lists all services and their runlevel settings.

Upstart (rarely used now):

status [service_name]

Shows the status of a specific service.

stop [service_name]

Stops a service.

start [service_name]

Starts a service.

initctl list

Lists all running Upstart jobs.

Last updated

Was this helpful?