Ubuntu – the difference between cat /etc/services and service –status-all

processservices

I would like to know the difference between these commands to show linux services:

cat /etc/services

and

service --status-all

Best Answer

The contents of /etc/services do not actually correspond to the services on your system. That file is actually a mapping of ports to the services that usually use them (say, port 22 by SSH). It's used by tools like netstat to give an understandable name in the output (instead of just dumping the port number). So it might, and usually does, have a large number of services listed that are not actually installed on your system.

The output of service --status-all is actually the status of installed services on your system.

See also: