# phpman > man > services(5)

[SERVICES(5)](https://www.chedong.com/phpMan.php/man/SERVICES/5/markdown)                           Linux Programmer's Manual                          [SERVICES(5)](https://www.chedong.com/phpMan.php/man/SERVICES/5/markdown)



## NAME
       services - Internet network services list

## DESCRIPTION
       **services**  is  a plain ASCII file providing a mapping between human-friendly textual names for
       internet services, and their underlying assigned port numbers and protocol types.  Every net‐
       working program should look into this file to get the port number (and protocol) for its ser‐
       vice.  The C library  routines  [**getservent**(3)](https://www.chedong.com/phpMan.php/man/getservent/3/markdown),  [**getservbyname**(3)](https://www.chedong.com/phpMan.php/man/getservbyname/3/markdown),  [**getservbyport**(3)](https://www.chedong.com/phpMan.php/man/getservbyport/3/markdown),  **setser**‐‐
       [**vent**(3)](https://www.chedong.com/phpMan.php/man/vent/3/markdown), and [**endservent**(3)](https://www.chedong.com/phpMan.php/man/endservent/3/markdown) support querying this file from programs.

       Port  numbers  are assigned by the IANA (Internet Assigned Numbers Authority), and their cur‐
       rent policy is to assign both TCP and UDP protocols when assigning a port number.  Therefore,
       most entries will have two entries, even for TCP-only services.

       Port  numbers  below  1024 (so-called "low numbered" ports) can be bound to only by root (see
       [**bind**(2)](https://www.chedong.com/phpMan.php/man/bind/2/markdown), [**tcp**(7)](https://www.chedong.com/phpMan.php/man/tcp/7/markdown), and [**udp**(7)](https://www.chedong.com/phpMan.php/man/udp/7/markdown)).  This is so clients connecting to low numbered ports can  trust
       that  the service running on the port is the standard implementation, and not a rogue service
       run by a user of the machine.  Well-known port numbers specified by the IANA are normally lo‐
       cated in this root-only space.

       The  presence  of  an entry for a service in the **services** file does not necessarily mean that
       the service is currently running on the machine.  See [**inetd.conf**(5)](https://www.chedong.com/phpMan.php/man/inetd.conf/5/markdown) for the configuration  of
       Internet  services  offered.   Note that not all networking services are started by [**inetd**(8)](https://www.chedong.com/phpMan.php/man/inetd/8/markdown),
       and so won't appear in [**inetd.conf**(5)](https://www.chedong.com/phpMan.php/man/inetd.conf/5/markdown).  In particular, news (NNTP) and mail (SMTP) servers are
       often initialized from the system boot scripts.

       The location of the **services** file is defined by ___**PATH**___**SERVICES** in _<netdb.h>_.  This is usually
       set to _/etc/services_.

       Each line describes one service, and is of the form:

              _service-name_   _port_**/**_protocol_   [_aliases_ _..._]

       where:

       _service-name_
              is the friendly name the service is known by and looked up under.  It is  case  sensi‐
              tive.  Often, the client program is named after the _service-name_.

       _port_   is the port number (in decimal) to use for this service.

       _protocol_
              is  the  type  of protocol to be used.  This field should match an entry in the **proto**‐‐
              [**cols**(5)](https://www.chedong.com/phpMan.php/man/cols/5/markdown) file.  Typical values include **tcp** and **udp**.

       _aliases_
              is an optional space or tab separated list of other names for  this  service.   Again,
              the names are case sensitive.

       Either spaces or tabs may be used to separate the fields.

       Comments  are  started  by  the  hash sign (#) and continue until the end of the line.  Blank
       lines are skipped.

       The _service-name_ should begin in the first column of the file, since leading spaces  are  not
       stripped.  _service-names_ can be any printable characters excluding space and tab.  However, a
       conservative choice of characters should be used to minimize compatibility problems.  For ex‐
       ample, a-z, 0-9, and hyphen (-) would seem a sensible choice.

       Lines  not  matching  this  format  should  not be present in the file.  (Currently, they are
       silently skipped by [**getservent**(3)](https://www.chedong.com/phpMan.php/man/getservent/3/markdown), [**getservbyname**(3)](https://www.chedong.com/phpMan.php/man/getservbyname/3/markdown), and [**getservbyport**(3)](https://www.chedong.com/phpMan.php/man/getservbyport/3/markdown).  However, this be‐
       havior should not be relied on.)

       This file might be distributed over a network using a network-wide naming service like Yellow
       Pages/NIS or BIND/Hesiod.

       A sample **services** file might look like this:

           netstat         15/tcp
           qotd            17/tcp          quote
           msp             18/tcp          # message send protocol
           msp             18/udp          # message send protocol
           chargen         19/tcp          ttytst source
           chargen         19/udp          ttytst source
           ftp             21/tcp
           # 22 - unassigned
           telnet          23/tcp

## FILES
       _/etc/services_
              The Internet network services list

       _<netdb.h>_
              Definition of ___**PATH**___**SERVICES**

## SEE ALSO
       [**listen**(2)](https://www.chedong.com/phpMan.php/man/listen/2/markdown), [**endservent**(3)](https://www.chedong.com/phpMan.php/man/endservent/3/markdown), [**getservbyname**(3)](https://www.chedong.com/phpMan.php/man/getservbyname/3/markdown), [**getservbyport**(3)](https://www.chedong.com/phpMan.php/man/getservbyport/3/markdown),  [**getservent**(3)](https://www.chedong.com/phpMan.php/man/getservent/3/markdown),  [**setservent**(3)](https://www.chedong.com/phpMan.php/man/setservent/3/markdown),
       [**inetd.conf**(5)](https://www.chedong.com/phpMan.php/man/inetd.conf/5/markdown), [**protocols**(5)](https://www.chedong.com/phpMan.php/man/protocols/5/markdown), [**inetd**(8)](https://www.chedong.com/phpMan.php/man/inetd/8/markdown)

       Assigned Numbers RFC, most recently RFC 1700, (AKA STD0002).

## COLOPHON
       This  page  is  part  of  release  5.10 of the Linux _man-pages_ project.  A description of the
       project, information about reporting bugs, and the latest version of this page, can be  found
       at <https://www.kernel.org/doc/man-pages/>.



Linux                                        2020-04-11                                  [SERVICES(5)](https://www.chedong.com/phpMan.php/man/SERVICES/5/markdown)
