<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>rockylinux on Ryan&#39;s Blog - 个人工作日志</title>
    <link>https://www.crs811.com/tags/rockylinux/</link>
    <description>Recent content in rockylinux on Ryan&#39;s Blog - 个人工作日志</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <copyright>Copyright © 2008–2018, Steve Francia and the Hugo Authors; all rights reserved.</copyright>
    <lastBuildDate>Mon, 01 Jun 2026 08:31:26 +0000</lastBuildDate><atom:link href="https://www.crs811.com/tags/rockylinux/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Rocky Linux 9 系统管理命令合辑</title>
      <link>https://www.crs811.com/archives/2208/</link>
      <pubDate>Mon, 01 Jun 2026 08:31:26 +0000</pubDate>
      
      <guid>https://www.crs811.com/archives/2208/</guid>
      <description>
        
          
            系统基础命令 系统信息查看 1# 查看系统版本 2cat /etc/redhat-release 3hostnamectl 4 5# 查看内核版本 6uname -a 7 8# 查看CPU信息 9lscpu 10 11# 查看内存信息 12free -h 进程与网络 1# 查看网络监听端口（推荐使用 ss 替代 netstat） 2ss -tuln # 查看所有监听端口 3ss -tulnp # 查看监听端口及对应进程 4 5# 查看后台进程 6ps aux | grep [进程名] 7ps -ef | grep [进程名] 8 9# 查看进程树 10pstree -p 文件查找 1# 全盘查找文件 2find / -type f -name &amp;#34;[文件名]&amp;#34; 3 4# 在指定目录中按内容查找（如 /etc） 5grep -r &amp;#34;content&amp;#34; /etc/ 2&amp;gt;/dev/null 6 7# 使用 find + xargs 组合 8find /etc -type f -print0 | xargs -0 grep &amp;#34;content&amp;#34; 9 10# 查找大文件（大于100M） 11find / -type f -size +100M -exec ls -lh {} \; 关机与重启 1# ========== systemctl 方式 ========== 2systemctl reboot # 重启 3systemctl poweroff # 关机（切断电源） 4systemctl halt # 停机（不切断电源） 5 6# ========== shutdown 方式 ========== 7shutdown -h now # 立即关机 8shutdown -h +2 # 2分钟后关机 9shutdown -h 10:01 # 10:01关机 10shutdown -r now # 立即重启 11shutdown -r +2 # 2分钟后重启 12shutdown -c # 取消已计划的关机/重启 13 14# ========== init 方式（传统SysV风格，兼容） ========== 15init 0 # 关机（运行级别0） 16init 6 # 重启（运行级别6） 17init 1 # 单用户模式 18init 3 # 多用户命令行模式 19init 5 # 图形界面模式 20 21# ========== 其他快捷命令 ========== 22reboot # 重启（通用） 23halt # 停机（不切断电源） 24poweroff # 关机（切断电源） 25 26# ========== 查看当前运行级别 ========== 27runlevel # 显示 当前级别 和 上次级别 28who -r # 查看当前运行级别 29systemctl get-default # 查看默认启动目标 网络与主机名 1# 临时禁ping 2echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all 3 4# 临时启用ping 5echo 0 &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all 6 7# 释放并重新获取IP（需安装 dhcp-client） 8dnf install -y dhcp-client 9dhclient -r # 释放IP 10dhclient # 重新获取IP 11 12# 设置主机名 13hostnamectl set-hostname [新主机名] systemctl 服务管理 1# 服务启动/停止/重启/状态 2systemctl start [服务名] 3systemctl stop [服务名] 4systemctl restart [服务名] 5systemctl status [服务名] 6 7# 示例：管理防火墙 8systemctl start firewalld 9systemctl stop firewalld 10systemctl restart firewalld 11systemctl status firewalld 12 13# 允许/禁止服务开机启动 14systemctl enable [服务名] 15systemctl disable [服务名] 16 17# 查看服务是否开机启动 18systemctl is-enabled [服务名] 19 20# 列出所有正在运行的服务 21systemctl list-units --type=service --state=running 22 23# 列出所有已安装服务的开机自启状态 24systemctl list-unit-files | grep enabled 25 26# 查看所有服务（含未运行的） 27systemctl list-unit-files --type=service 系统运行级别（目标）设置 Rocky Linux 9 使用 systemd 目标替代传统的运行级别。
          
          
        
      </description>
    </item>
    
  </channel>
</rss>
