速查表(一句话版)

系统 自启 计划任务
Ubuntu systemctl list-unit-files --state=enabled crontab -l && systemctl list-timers
CentOS/RHEL systemctl list-unit-files --state=enabled crontab -l && systemctl list-timers
Windows reg query "HKLM\...\Run" schtasks /query
macOS ls ~/Library/LaunchAgents/ launchctl list && crontab -l
FreeBSD service -e crontab -l && ls /etc/periodic/

Ubuntu / Debian / Linux Mint

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 系统级 systemd 自启服务
systemctl list-unit-files --type=service --state=enabled

# 用户级 systemd 自启服务
systemctl --user list-unit-files --state=enabled

# 传统 SysV 自启脚本
ls /etc/init.d/ # 查看所有脚本
grep -Rl "Default-Start.*2" /etc/init.d/ # 筛选 2 级别自启

# 桌面环境自启项(当前用户)
ls ~/.config/autostart/

# 桌面环境自启项(全局)
ls /etc/xdg/autostart/

# 当前用户计划任务
crontab -l

# 系统级计划任务
cat /etc/crontab
ls /etc/cron.{d,daily,hourly,weekly,monthly}/

# systemd 定时器(现代 cron 替代)
systemctl list-timers --all

CentOS / RHEL / Rocky / Alma / Fedora

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 系统级 systemd 自启服务
systemctl list-unit-files --type=service --state=enabled

# 用户级 systemd 自启服务
systemctl --user list-unit-files --state=enabled

# 兼容旧版 chkconfig 查看 SysV 自启
chkconfig --list 2>/dev/null || echo "无 chkconfig"

# 桌面环境自启项(当前用户)
ls ~/.config/autostart/

# 桌面环境自启项(全局)
ls /etc/xdg/autostart/

# 当前用户计划任务
crontab -l

# 系统级计划任务
cat /etc/crontab
ls /etc/cron.d/

# systemd 定时器
systemctl list-timers --all

Arch Linux / Manjaro / EndeavourOS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 系统级 systemd 自启服务
systemctl list-unit-files --type=service --state=enabled

# 用户级 systemd 自启服务
systemctl --user list-unit-files --state=enabled

# 桌面环境自启项(当前用户)
ls ~/.config/autostart/

# 桌面环境自启项(全局)
ls /etc/xdg/autostart/

# 当前用户计划任务
crontab -l

# 系统级计划任务
cat /etc/crontab
ls /etc/cron.d/

# systemd 定时器
systemctl list-timers --all

Windows 10 / 11 / Server

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
:: 系统级注册表自启
reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"

:: 当前用户注册表自启
reg query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"

:: 图形化启动项(任务管理器)
taskmgr :: 切换到“启动”标签页

:: 当前运行的服务
sc query type=service state=active

:: 计划任务(命令行)
schtasks /query /fo table /v

:: 计划任务(图形化)
taskschd.msc

macOS / OS X

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 系统级守护进程(root)
ls /Library/LaunchDaemons/

# 当前用户代理
ls ~/Library/LaunchAgents/

# 系统级代理
ls /System/Library/LaunchAgents/

# 图形化登录项
# 系统设置 → 用户与群组 → 登录项

# 列出所有已加载的 launchd 任务
launchctl list

# 传统 cron 任务
crontab -l

FreeBSD

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# rc.conf 中启用的服务
sysrc -a | grep -E '_enable="YES"'

# 当前已启用服务列表
service -e

# 当前用户计划任务
crontab -l

# 系统级计划任务
cat /etc/crontab
ls /etc/cron.d/

# periodic 定时脚本
ls /etc/periodic/{daily,hourly,weekly,monthly}/