In *systemd-based systems* (most modern Linux distributions), *targets* are used to define different states or modes that the system can boot into, such as multi-user mode, graphical mode, or rescue mode. You can configure your system to boot into a specific target automatically.
Configure the System to Boot into a Specific Target:
1. **List available targets**:
You can check available targets with:
```bash
systemctl list-units --type=target
```
2. **Set the default target**:
To change the default boot target (for example, to boot into *graphical* mode, which includes a graphical user interface), use the following command:
```bash
sudo systemctl set-default target
```
Common targets:
**graphical.target**: Multi-user mode with a graphical user interface (default for most desktop systems).
**multi-user.target**: Multi-user mode without a graphical interface (default for many server systems).
**rescue.target**: Rescue mode (single-user mode for recovery).
**reboot.target**: Reboot the system.
Example: Set the system to boot into *graphical* mode:
```bash
sudo systemctl set-default graphical.target
```
3. **Reboot the system**:
Once you’ve set the default target, reboot your system:
```bash
sudo reboot
```
After rebooting, the system will automatically boot into the specified target.
Example Use Cases:
**Set to multi-user mode (no GUI)**:
```bash
sudo systemctl set-default multi-user.target
```
**Set to graphical mode (with GUI)**:
```bash
sudo systemctl set-default graphical.target
```
In summary, you configure a system to boot into a specific target by using `systemctl set-default target`, which sets the desired run level (target) for the system to start at boot time.