Control Statements and Functions
Control Statements and Functions
AND FUNCTIONS.
1.PACKAGE MANAGEMENT WITH APT AND
YUM.
• APT and YUM are both package management tools for Linux systems that help users
install, update, and remove software packages:
• APT
• The Advanced Package Tool is the default package manager for Debian-based Linux
distributions, such as Ubuntu and Linux Mint. APT uses the .deb file extension for
packages.
• YUM
• The Yellowdog Updater, Modified is the default package manager for Red Hat-based
Linux distributions, such as CentOS, Fedora, and Red Hat Enterprise Linux. YUM uses
the .rpm file extension for packages
• Here are some differences between APT and YUM
• Supported installation package format: APT
supports .deb files, while YUM supports .rpm files.
• Configuration files: APT's configuration file is located at
/etc/apt/apt.conf, while YUM's configuration file is located
at /etc/yum.conf.
• Command options: Some of the most used APT options
include update, upgrade, install, remove, purge, list, and
search. Some of the most used YUM options include install,
remove, search, info, and update.
• Upgrades: The sudo apt upgrade command upgrades all
packages to the latest stable version, while the yum update
command upgrades installed packages to the latest version.
• Change rollbacks: YUM allows changes to be rolled back.
KERNEL UPDATES AND SYSTEM REBOOT
• Performance and Hardware Support : Newer kernels can offer better performance and
support for the latest hardware.
• Bug Fixes and New Features : Updates can address bugs and introduce new features
relevant to your system and testing tools.
HOW TO REBOOT LINUX
To reboot Linux, you can use the command line interface (CLI)
or the terminal:
•Reboot command: To reboot immediately, use the sudo reboot command
in the terminal.
•Shutdown command: To reboot with a delay, use the sudo shutdown -r
+5 command in the terminal. To schedule a reboot, use the + option
followed by a time in the format hh:mm. To cancel a scheduled reboot, use
the shutdown -c command.
•systemctl command: To restart a Linux server, use
the systemctl command. This command requires sudo or root privileges.
The time it takes to reboot Linux depends on the hardware and
resources assigned to the system
LOG FILE ANALYSIS AND
TROUBLESHOOTING
• what are log files?
• og files are computer-generated files that record events and activities that occur within
a system, application, or server. They can include information about:
• processes, messages, transactions, errors, intrusions, and usage patterns.
• Log files can be used to: Show whether resources are performing properly, Diagnose
errors, Track events in complex systems, Record every request made to a server, and
Capture information related to network traffic.
• Log files can be in structured, semi-structured, or unstructured formats. They can be
transmitted in different ways and are a valuable source of information for developers,
system administrators, and security analysts
Open a basic text editor and double-click the log file to open it. For
example, Windows uses Notepad to open .LOG files.
•Use a web browser
Drag the log file into the browser window or press Ctrl+O to open a
dialogue box where you can search for the file.
•Use a log viewer
Use a log viewer built into the software application you're using. For
example, Configuration Manager log files can be viewed with
CMTrace, OneTrace, or the Support Center log file viewer.
•Use a command-line interface
Use a command-line interface to view the file. For example, to view
system logs on Linux, you can open a terminal window, issue the
command cd /var/log, and then issue the command ls.
WHAT CONTENT ARE PRESENT IN LOG FILES(ANY 5 LOG FILES
TO BE EXPLAINED)?
• 2. server
• These log files include information about what is happening on the server, what the
service or process is doing, and what, if any errors or warnings are generated.
Amazon Web Services
• 3.Activites:
• hey include a historical record of all processes, events, and
messages along with additional descriptive data, such as
timestamps, to contextualize this information. Timestamps
show you what happened inside the system and when it
happened
• 4.IT system:
• They include a historical record of all processes, events, and
messages along with additional descriptive data, such as
timestamps, to contextualize this information. Timestamps
show you what happened inside the system and when it
happened