Verified
systemctl list-units --type=target - View all active targets on the system.
systemctl list-units --type=target --all - View all targets installed on the disk.
systemctl get-default - Display the current default target.
systemctl list-units --type=target | grep multi-user.target - check if multi-user target is available
systemctl set-default multi-user.target - Change the default target to the multi-user target
systemctl -t help - View all available systemd configuration units.
systemctl status sshd.service - Find the status of the sshd service.
systemctl list-units --type=service - List all active service unit configuration files.
systemctl is-active httpd - Determine if the httpd service is active.
systemctl is-enabled httpd - Determine if the httpd service is enabled
systemctl list-unit-files --type=service --all - View enabled and disabled settings for all units of the type
"service"
systemctl list-units --type=service --all - List all service unit configuration files, whether they are active or
not
, systemd.unit=rescue.target - Change the Boot Target
shutdown +5 shutdown messages goes here - Using the shutdown command, schedule a shutdown for
five minutes from now and notify all users on the system of the shutdown
shutdown -r now - Using the shutdown command, reboot the machine immediately without delay.
systemctl halt - Using systemctl, shutdown the system.
shutdown 01:00 - Schedule the system for a shutdown at 1:00 A.M. in the morning.
shutdown -c - Cancel the scheduled shutdown.
systemctl reboot - Using systemctl, reboot the the system.
systemctl halt
systemctl poweroff
shutdown -P
init 0 - Using any method of your choice, power off the system.
pkill -t pts/0 - kill all of the "user" user's processes
pgrep -u user
pkill -u user ssh - Find all running processes left, which should either be Bash or SSH and kill it
nice -n -20 httpd - Start the httpd service with the most favorable nice possible.
ps axo pid,comm,nice | grep httpd
ps axo pid,comm,nice --sort=-nice | grep httpd - View the current nice of the httpd service using the ps
command and grep command together.