SoFunction
Updated on 2025-03-10

One sentence shell command closes unwanted random start service

Linux can simply use a shell command to close other unnecessary boot services, only retain scheduled tasks, network, ssh and logs, and see shell commands:

Copy the codeThe code is as follows:

chkconfig --list | grep 3:on | \
grep -v "crond\|network\|sshd\|syslog" | \
awk '{print "chkconfig " $1 " off"}' | sh

This shell command can successfully close other startup services in RedHat and Centos tests, but other Linux systems are unknown.