How to check if a particular service is running on Ubuntu

前端 未结 13 1921
猫巷女王i
猫巷女王i 2021-01-29 17:48

I do not know the service\'s name, but would like to stop the service by checking its status.

For example, if I want to check if the PostgreSQL service is running or no

13条回答
  •  佛祖请我去吃肉
    2021-01-29 18:06

    the best way is using of nmap tool in terminal. nmap is an useful tool that analyse an up system, using it's IP Address, then show all actived network services.

    open terminal and use of this example :

    ~$ nmap 192.168.1.3/24
    
    Starting Nmap 5.21 ( http://nmap.org ) at 2016-05-16 22:49 IRDT
    Nmap scan report for 192.168.1.3
    Host is up (0.00020s latency).
    Not shown: 994 closed ports
    PORT     STATE SERVICE
    22/tcp   open  ssh
    23/tcp   open  telnet
    139/tcp  open  netbios-ssn
    445/tcp  open  microsoft-ds
    3389/tcp open  ms-term-serv
    3689/tcp open  rendezvous
    

提交回复
热议问题