# System

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