System
shutdown
Shutdown the system.
sudo shutdown -h now → Shuts down the system immediately.
reboot
Reboot the system.
sudo reboot → Reboots the system.
halt
Halt the system (immediate shutdown).
sudo halt → Halts the system.
poweroff
Power off the system.
sudo poweroff → Powers off the system.
systemctl
Control the systemd system and service manager.
systemctl status → Shows the current status of the system.
init
Change the runlevel of the system.
sudo init 0 → Changes to runlevel 0 (shutdown).
runlevel
Display the current runlevel of the system.
runlevel → Displays the current runlevel.
sysctl
Get or set kernel parameters.
sysctl -a → Lists all kernel parameters.
journalctl
Query and view logs from systemd’s journal.
journalctl -xe → Shows system logs for errors.
lsmod
Show the loaded kernel modules.
lsmod → Displays the currently loaded kernel modules.
modprobe
Add or remove kernel modules.
sudo modprobe <module_name> → Loads a kernel module.
lsb_release -a
Show Linux distribution information.
lsb_release -a → Displays distribution details.
nice
Start a process with a modified scheduling priority.
nice -n 10 command → Runs command with a priority of 10.
renice
Change the priority of a running process.
renice -n 15 1234 → Changes the priority of process with PID 1234 to 15.
cron
Daemon to execute scheduled commands.
crontab -e → Edit the current user's cron jobs.
at
Schedule a command to be run once at a specific time.
at 10:00 → Schedules a command to run at 10 AM.
systemctl reboot
Reboot the system using systemd.
sudo systemctl reboot → Reboots the system.
systemctl stop
Stop a systemd service.
sudo systemctl stop apache2 → Stops the apache2 service.
systemctl start
Start a systemd service.
sudo systemctl start apache2 → Starts the apache2 service.
systemctl enable
Enable a systemd service to start on boot.
sudo systemctl enable apache2 → Enables apache2 service at boot.
systemctl disable
Disable a systemd service from starting on boot.
sudo systemctl disable apache2 → Disables apache2 service at boot.
systemctl status
View the status of a service.
systemctl status apache2 → Displays the status of the apache2 service.
sudo
Execute a command as another user, typically root.
sudo apt update → Run apt update with root privileges.
passwd
Change the password of a user.
passwd john → Changes john's password.
Last updated