首页 > 系统相关 >centos(linux): systemctl列出所有运行中/自启动的服务

centos(linux): systemctl列出所有运行中/自启动的服务

时间:2024-10-24 09:44:59浏览次数:1  
标签:service centos -- list systemctl 自启动 列出

一,列出所有服务:

 systemctl list-units --type=service 

二,列出所有运行中的服务

1, 用--state指定状态

systemctl list-units --type=service --state=running

2,直接grep

systemctl list-units --type=service | grep running

三,列出所有自启动的服务

1,列出所有自启动的单元

除了服务,还包括:socket/target/timer

systemctl list-unit-files --state=enabled

2,列出所有自启动的服务

systemctl list-unit-files --type=service --state=enabled

 

标签:service,centos,--,list,systemctl,自启动,列出
From: https://www.cnblogs.com/architectforest/p/18498895

相关文章

  • 使用certbot在centos7搭建ssl证书并且自动续约
    检查centos版本$cat/etc/centos-releaseCentOSLinuxrelease7.9.2009(Core)检查python\nginx版本$python-VPython2.7.5$nginx-vnginxversion:nginx/1.26.1这里服务器自带了python2.7.5,如果没有,可以安装sudoyuminstallpython27更新pip并安装certbotp......
  • centos7 安装 rclone
    1.下载安装wgethttps://tos-tools.tos-cn-beijing.volces.com/third-party%2Frclone-current-linux-amd64.zipunzipthird-party%2Frclone-current-linux-amd64.zipcdrclone-v1.58.0-linux-amd642.拷贝二进制文件并修改权限sudocprclone/usr/bin/sudochownroot:root......
  • Centos8 共享NFS 操作手册
    文章结构问题解决问题解决:Failedtodownloadmetadataforrepo‘appstream‘:Cannotprepareinternalmirrorlist:...大家都知道Centos8于2021年年底停止了服务,大家再在使用yum源安装时候,出现下面错误“错误:Failedtodownloadmetadataforrepo‘AppStream’:Cannot......
  • centos7 部署内部dns
    1.安装sudoyuminstallbind-y2.配置cp/etc/named.conf/etc/named.conf.bakcp/etc/named.rfc1912.zones/etc/named.rfc1912.zones.bakvim/etc/named.confvim/etc/named.rfc1912.zonescd/var/namedcp-pnamed.localhostdlyphone.comvim/var/named/dlyphone.......
  • Windows基础(三):注册表与自启动
     https://bu1.github.io/2021/10/30/Windows%E5%9F%BA%E7%A1%80(%E4%B8%89)%EF%BC%9A%E6%B3%A8%E5%86%8C%E8%A1%A8%E4%B8%8E%E8%87%AA%E5%90%AF%E5%8A%A8/ 本文简要介绍了Windows的注册表以及自启动管理。注册表注册表是控制计算机硬件和软件的一整套数据。如果对注册表熟......
  • Centos7二进制部署k8s
    前言:确保自己的配置正确,设计到很多文件相关配置导致不正确的就复制配置给ai编辑顺序在运行,报错有可能顺序出了问题,或者通过查看日志来观察哪里报错)一、部署etcd集群三台机器,所有机器相互做解析centos7.4关闭防⽕墙和selinux#sudosystemctlstopfirewalld#sudosete......
  • CentOS7换yum源(出现yum下载不了东西)
    1.如果您的系统提示默认yum源无法使用,或者是安装yuminstall安装软件包失败,可以参考2.可以直接按顺序执行下面5句话,前提是您的服务器是默认使用的是官方yum。  验证:cd/etc/yum.repos.d,利用ls查看是否存在CentOS-Base.repo文件,存在即是的。 #切换到yum仓库配置目录......
  • Linux使用nc(netcat)命令检测网络端口是否畅通以及Linux查看CPU架构命令arch及CentOS
    一、Linux使用nc(netcat)命令检测网络端口是否畅通    nc命令netcat的简写,netcat即是网络猫的意思,在linux系统中nc命令实际执行命令是ncat。nc命令是一个功能强大的网络工具。平常主要用于实现TCP/UDP端口的侦听和收发,nc可作为server以TCP或UDP方式侦听指定端口,也可作为cl......
  • Linux下安装Nginx,CentOS7安装Nginx
    首先,需要安装一些编译Nginx所需的依赖包,使用以下命令:yum-yinstallgccpcre-develzlib-developenssl-devel下载https://nginx.org/en/download.html上传到opt目录下或者直接在linux系统里下载wgethttp://nginx.org/download/nginx-1.26.2.tar.gz如果command......
  • 在 CentOS 上安装和配置 GeoServer并配置为系统服务
    CentOS上安装和配置GeoServer作为系统服务1.安装GeoServer下载GeoServer:从GeoServer官方网站下载最新版本的GeoServer压缩包。解压文件:tar-zxvfgeoserver-2.25.3-bin.zip-C/usr/local2.创建systemd服务文件创建服务文件:sudonano/etc/syste......