What Is /etc/services in Linux / Unix?

/etc/services in linux

Definition: /etc/services: On UNIX, the configuration file /etc/services maps port numbers to named services. Key point: Its role in life is so that programs can do a getportbyname() sockets call in their code in order to get what port they should use. For example, a POP3 email daemon would do a getportbyname ("pop3") in order to retrieve the number 110 that pop3 runs at. The idea is that if all POP3 daemons use getportbyname(), then no matter what POP3 daemon you run, you can always reconfigure its port number by editing / etc/services.

Misunderstanding: This file is bad in order to figure out what port numbers mean. If you want to find out what ports programs are using, you should instead use the program lsof to find out exactly which ports are bound to which processes. If running lsof is not appropriate, then you should lookup the ports in a more generic reference.

.................................
Source: Hacking-Lexicon / Linux Dictionary V 0.16
http://www.tldp.org/LDP/Linux-Dictionary/html/index.html
Author: Binh Nguyen linuxfilesystem(at)yahoo(dot)com(dot)au
.................................

> Linux/Unix/Computing Glossary