Skill Week 2
Skill Week 2
Skill Week 2
Provide the commands to boot, reboot, and shut down a Linux system. Explain the difference
between the commands shutdown, reboot, and halt.
Boot
Booting a Linux system typically involves powering on the machine. This is usually done
through the physical power button on the hardware. However, if you have a virtual machine or
a remote system, the boot process may be initiated through the virtualization or remote
management tools.
Reboot
To reboot a Linux system, you can use one of the following commands:
$ sudo reboot
or
or
$ sudo init 6
Shut Down
To shut down a Linux system, you can use one of the following commands:
or
$ sudo poweroff
or
$ sudo halt
Difference Between shutdown, reboot, and halt
shutdown:
The shutdown command can be used to power off or reboot the system. It can schedule a
shutdown or reboot at a specific time.
reboot:
The reboot command is a straightforward way to restart the system. It is essentially
equivalent to shutdown -r now.
It does not provide options for scheduling but directly triggers an immediate reboot.
halt:
The halt command stops all processes but does not necessarily power off the machine,
depending on the system configuration. It is often used to bring the system to a halt state.
When used without options, it can leave the system in a halted state without cutting power.
Practical Examples
Immediate Shutdown:
Scheduled Shutdown:
This will schedule a shutdown in 10 minutes and broadcast a message to all logged-in users.
Immediate Reboot:
$ sudo reboot
Immediate Halt:
$ sudo halt
$ sudo poweroff
These commands are essential for managing the operational state of a Linux system and are
commonly used by system administrators to ensure proper maintenance and control over the
system's uptime and performance.
Boot Loader:
In CentOS/RHEL systems, the primary bootloader used is GRUB (GRand Unified Bootloader).
GRUB is responsible for loading the Linux kernel and initializing the operating system during
the boot process. This guide covers the basic concepts of GRUB, its configuration, and
common tasks such as updating and troubleshooting.
GRUB Basics
$ systemctl get-default
This command will show the default target that the system boots into.
$ journalctl -b
$ journalctl -u <service_name>
Start a service:
Stop a service:
Restart a service:
Example:
Example:
Example:
Example:
Open the configuration file for your network interface, for example, ifcfg-eth0.
$ sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.1.100
PREFIX=24
GATEWAY=192.168.1.1
DNS1=8.8.8.8
$ sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0
IPV6INIT=yes
IPV6ADDR=2001:db8::1/64
IPV6_DEFAULTGW=2001:db8::fffe
DNS1=2001:4860:4860::8888
Verification
By using either ‘nmcli’ or manually editing the configuration files, you can configure both IPv4 and
IPv6 addresses on CentOS/RHEL systems. The choice between these methods depends on your
preference and the specific requirements of your environment.
Tasks to be done by student in RHA Portal/ Oracle VM (CentOS)
Describe the steps and provide the command to install the httpd package
1
from the Red Hat Network using dnf.
How would you update the httpd package to the latest version available in
2
the configured remote repository using dnf? Provide the command.