{
    "mode": "man",
    "parameter": "services",
    "section": "5",
    "url": "https://www.chedong.com/phpMan.php/man/services/5/json",
    "generated": "2026-06-12T14:01:46Z",
    "sections": {
        "NAME": {
            "content": "services - Internet network services list\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "services  is  a plain ASCII file providing a mapping between human-friendly textual names for\ninternet services, and their underlying assigned port numbers and protocol types.  Every net‐\nworking program should look into this file to get the port number (and protocol) for its ser‐\nvice.  The C library  routines  getservent(3),  getservbyname(3),  getservbyport(3),  setser‐‐\nvent(3), and endservent(3) support querying this file from programs.\n\nPort  numbers  are assigned by the IANA (Internet Assigned Numbers Authority), and their cur‐\nrent policy is to assign both TCP and UDP protocols when assigning a port number.  Therefore,\nmost entries will have two entries, even for TCP-only services.\n\nPort  numbers  below  1024 (so-called \"low numbered\" ports) can be bound to only by root (see\nbind(2), tcp(7), and udp(7)).  This is so clients connecting to low numbered ports can  trust\nthat  the service running on the port is the standard implementation, and not a rogue service\nrun by a user of the machine.  Well-known port numbers specified by the IANA are normally lo‐\ncated in this root-only space.\n\nThe  presence  of  an entry for a service in the services file does not necessarily mean that\nthe service is currently running on the machine.  See inetd.conf(5) for the configuration  of\nInternet  services  offered.   Note that not all networking services are started by inetd(8),\nand so won't appear in inetd.conf(5).  In particular, news (NNTP) and mail (SMTP) servers are\noften initialized from the system boot scripts.\n\nThe location of the services file is defined by PATHSERVICES in <netdb.h>.  This is usually\nset to /etc/services.\n\nEach line describes one service, and is of the form:\n\nservice-name   port/protocol   [aliases ...]\n\nwhere:\n\nservice-name\nis the friendly name the service is known by and looked up under.  It is  case  sensi‐\ntive.  Often, the client program is named after the service-name.\n\nport   is the port number (in decimal) to use for this service.\n\nprotocol\nis  the  type  of protocol to be used.  This field should match an entry in the proto‐‐\ncols(5) file.  Typical values include tcp and udp.\n\naliases\nis an optional space or tab separated list of other names for  this  service.   Again,\nthe names are case sensitive.\n\nEither spaces or tabs may be used to separate the fields.\n\nComments  are  started  by  the  hash sign (#) and continue until the end of the line.  Blank\nlines are skipped.\n\nThe service-name should begin in the first column of the file, since leading spaces  are  not\nstripped.  service-names can be any printable characters excluding space and tab.  However, a\nconservative choice of characters should be used to minimize compatibility problems.  For ex‐\nample, a-z, 0-9, and hyphen (-) would seem a sensible choice.\n\nLines  not  matching  this  format  should  not be present in the file.  (Currently, they are\nsilently skipped by getservent(3), getservbyname(3), and getservbyport(3).  However, this be‐\nhavior should not be relied on.)\n\nThis file might be distributed over a network using a network-wide naming service like Yellow\nPages/NIS or BIND/Hesiod.\n\nA sample services file might look like this:\n\nnetstat         15/tcp\nqotd            17/tcp          quote\nmsp             18/tcp          # message send protocol\nmsp             18/udp          # message send protocol\nchargen         19/tcp          ttytst source\nchargen         19/udp          ttytst source\nftp             21/tcp\n# 22 - unassigned\ntelnet          23/tcp\n",
            "subsections": []
        },
        "FILES": {
            "content": "/etc/services\nThe Internet network services list\n\n<netdb.h>\nDefinition of PATHSERVICES\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "listen(2), endservent(3), getservbyname(3), getservbyport(3),  getservent(3),  setservent(3),\ninetd.conf(5), protocols(5), inetd(8)\n\nAssigned Numbers RFC, most recently RFC 1700, (AKA STD0002).\n",
            "subsections": []
        },
        "COLOPHON": {
            "content": "This  page  is  part  of  release  5.10 of the Linux man-pages project.  A description of the\nproject, information about reporting bugs, and the latest version of this page, can be  found\nat https://www.kernel.org/doc/man-pages/.\n\n\n\nLinux                                        2020-04-11                                  SERVICES(5)",
            "subsections": []
        }
    },
    "summary": "services - Internet network services list",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "listen",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/listen/2/json"
        },
        {
            "name": "endservent",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/endservent/3/json"
        },
        {
            "name": "getservbyname",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/getservbyname/3/json"
        },
        {
            "name": "getservbyport",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/getservbyport/3/json"
        },
        {
            "name": "getservent",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/getservent/3/json"
        },
        {
            "name": "setservent",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/setservent/3/json"
        },
        {
            "name": "inetd.conf",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/inetd.conf/5/json"
        },
        {
            "name": "protocols",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/protocols/5/json"
        },
        {
            "name": "inetd",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/inetd/8/json"
        }
    ]
}