➢ 1991 - Linux Kernel: The first Linux kernel was released by Linus Torvalds on September 17, 1991.
➢ 1992 - Yggdrasil Linux/GNU/X: One of the earliest Linux distributions, Yggdrasil was first released in December 1992.
➢ 1993 – Slackware: one of the oldest distributions still active today, was first released on July 16, 1993.
➢ 1993 – Debian: was announced by Ian Murdock on August 16, 1993, and remains a foundational distribution for many
others.
➢ 1994 - Red Hat Linux: The first official release of Red Hat Linux was in May 1995, after beta releases in late 1994.
➢ 1994 - SUSE Linux:Originally a derivative of Slackware, SUSE Linux was first released in 1994.
➢ 1996 - Caldera OpenLinux: was introduced in 1996 and was one of the first distributions aimed at businesses.
➢ 1998 - Mandrake Linux: Mandrake Linux, based on Red Hat, was first released in July 1998. It was later rebranded as
Mandriva.
➢ 2000 – Knoppix: known for being a live CD distribution, was first released in 2000.
➢ 2000 - Gentoo Linux: known for its customization and source-based package management, was first released in 2002,
though development started in 2000.
➢ 2002 - Arch Linux: a lightweight and flexible distribution, was first released in March 2002.
➢ 2003 – Fedora: was first released on November 6, 2003, as the community-supported successor to Red Hat Linux.
➢ 2004 – Ubuntu: based on Debian, was first released on October 20, 2004, and became widely popular for its ease of use.
➢ 2006 - Linux Mint: was first released in August 2006, based on Ubuntu, with a focus on providing a user-friendly desktop
experience.
➢ 2007 - Puppy Linux: known for its small size and fast performance, was first released in 2003, but gained broader
attention with its 2007 release.
➢ 2009 – Chakra: initially derived from Arch Linux, was first released in 2009, focusing on a KDE desktop environment.
➢ 2011 – Mageia: was forked from Mandriva Linux and first released in September 2010, with the stable version arriving in
June 2011.
➢ 2012 - Elementary OS: known for its beautiful design and user-friendly interface, was first released in 2012.
➢ 2013 – Manjaro: based on Arch Linux, was first released in July 2013, aiming to provide a more accessible version of
Arch.
➢ 2015 – Solus: a distribution built from scratch with a focus on desktop usability, was first released in December 2015.
➢ 2017 - Pop!_OS: developed by System76, was first released in October 2017, and is known for being optimized for their
hardware and providing a great out-of-the-box experience.
➢ 2020 - Zorin OS: focused on providing a Windows-like experience for newcomers to Linux, released its first version in
2008, but gained significant attention with its 2020 releases.
➢ 2021 – AlmaLinux: was released in March 2021 as a community-driven fork of CentOS, aimed at providing a free and
open-source RHEL-compatible distribution.
➢ 2021 - Rocky Linux: another RHEL-compatible distribution, was released in June 2021, founded by the original CentOS
creator Gregory Kurtzer.
➢ 2022 - SteamOS 3.0: a Linux distribution developed by Valve Corporation for their Steam Deck handheld gaming device,
was released in 2022.
➢ 2023 - Vanilla OS: was launched in December 2022, gaining more traction in 2023. It is an immutable OS based on
Ubuntu, with a focus on stability and security.
➢ 2024 - Nobara Project: a Fedora-based distribution tailored for gamers, content creators, and Linux newcomers, was
created by developer GloriousEggroll, and gained attention in 2023-2024.
Linux Features
• Multiuser capability: Multiple users can access the same system resources like memory, hard disk,
etc. But they have to use different terminals to operate.
• Multitasking: More than one function can be performed simultaneously by dividing the CPU time
intelligently.
• Portability: Portability doesn't mean it is smaller in file size or can be carried in pen drives or
memory cards. It means that it support different types of hardware.
• Security: It provides security in three ways namely authenticating (by assigning password and login
ID), authorization (by assigning permission to read, write and execute) and encryption (converts file
into an unreadable format).
• Live CD/USB: Almost all Linux distros provide live CD/USB so that users can run/try it without
installing it.
• Graphical User Interface (X Window system): Linux is command line based OS but it can be
converted to GUI based by installing packages.
• Support's customized keyboard: As it is used worldwide, hence supports different languages
keyboards.
• Application support: It has its own software repository from where users can download and install
many applications.
• File System: Provides hierarchical file system in which files and directories are arranged.
• Open Source: Linux code is freely available to all and is a community based development project.
Feature Linux Windows
Source Code Open Source Closed Source
Licensing Typically licensed under GNU GPL Proprietary, requires purchase of a license
User Interface
Highly customizable with various desktop
environments
Standardized interface with limited
customization
Distributions
Numerous distributions (e.g., Ubuntu, Fedora,
Arch, etc.)
Single distribution controlled by Microsoft
Software Installation Package managers (e.g., APT, YUM, DNF) Executable files (.exe) and Microsoft Store
Software Availability
Extensive open-source software, limited
proprietary software
Wide range of commercial and proprietary
software
Security Strong security model, less targeted by malware
Improved security, but more frequently targeted
by malware
Performance Efficient, can run on a wide range of hardware
Resource-intensive, performs best on modern
hardware
System Requirements Can run on low-resource or older systems
Typically requires more resources, especially with
newer versions
Command Line
Interface
Command line is central, offers powerful control
GUI-focused, command line (CMD/PowerShell)
less commonly used
Community Support
Large, active community with extensive forums
and documentation
Official support from Microsoft, with online
resources
Updates and Upgrades
User-controlled updates, distributions may have
rolling releases
Automatic updates, major upgrades require a
new license/version
Customization
Highly customizable, from kernel to desktop
environment
Limited customization options
Use Cases
Preferred for servers, development,
programming, and customization
Widely used in business, gaming, and general-
purpose computing
Feature Linux Unix
Origin Created by Linus Torvalds in 1991 Developed at AT&T's Bell Labs in the early 1970s
Source Code Open Source, freely available Mostly proprietary, with some open-source variants (e.g., BSD)
Licensing GNU General Public License (GPL) Commercial licenses, with exceptions like BSD's open license
Development Model
Community-driven, with contributions from individuals and
corporations
Corporate-driven, typically by the owning company
Distributions Numerous distributions (e.g., Ubuntu, Red Hat, Debian) Multiple proprietary versions (e.g., AIX, HP-UX, Solaris)
Kernel Monolithic Linux kernel Typically monolithic, but varies by implementation
User Interface Variety of desktop environments and user interfaces
Commonly uses command-line interface (CLI), though some
versions have GUIs
System Usage
Widely used in servers, desktops, embedded systems, and
development environments
Primarily used in enterprise servers, workstations, and mainframes
Customization Highly customizable at both kernel and user interface levels
Customizable, but generally requires more expertise and may be
limited by the proprietary nature
Security Strong security features, with active community support Strong security, often used in critical enterprise environments
Hardware Compatibility Supports a wide range of hardware, including x86, ARM, and more Typically supports specific, high-end hardware systems
Updates and Upgrades Frequent updates, user-controlled, with rolling-release options
Updates are controlled by the vendor, often with a focus on
stability
Market Share Dominant in web servers, cloud infrastructure, and supercomputing
Predominantly used in enterprise environments, with declining
use outside of niche markets
Community Support
Large, active community with extensive forums and
documentation
Smaller, specialized community, often dependent on vendor
support
Commercial Support Available from companies like Red Hat, Canonical, and SUSE Provided by the vendor (e.g., IBM for AIX, Oracle for Solaris)
GNU
The GNU operating system is a complete free software system, upward-compatible with
Unix. GNU stands for “GNU's Not Unix”. It is pronounced as one syllable with a hard g.
Richard Stallman made the Initial Announcement of the GNU Project in September 1983. A
longer version called the GNU Manifesto was published in March 1985. It has been
translated into several other languages.
The word “free” in “free software” pertains to freedom, not price. You may or may not pay a
price to get GNU software. Either way, once you have the software you have four specific
freedoms in using it.
• The freedom to run the program as you wish;
• The freedom to copy the program and give it away to your friends and co-workers;
• The freedom to change the program as you wish, by having full access to source code
• The freedom to distribute an improved version and thus help build the community.
Virus free Linux
❑ Linux Security: Linux is architecturally robust and generally secure against threats, though not completely
immune. Scripts written for RPM-based systems (like RedHat) can't infect Debian-based systems, and system-
wide changes require root access. A strong root password enhances security.
❑ Password Requirement: Linux requires passwords for all users except 'Guest,' unlike Windows, which can have
accounts without passwords.
❑ Program Permissions: In Linux, programs require permission (sudo) or root access to install or uninstall,
whereas Windows programs can be managed without administrator consent.
❑ GUI vs. CLI: Linux can operate effectively without a GUI, which is often disabled by administrators for security.
Windows requires a GUI to function.
❑ Firewall and SELinux: Linux's Security-Enhanced Linux (SELinux) provides robust access control and security
policies. While SELinux is not mandatory for normal use, it's crucial for network users and administrators.
❑ Antivirus and Encryption: Install Clam AV for additional protection on networked systems. You can also
encrypt disks, use a boot loader password, and set custom user roles.
Linux Distributions (Distros):
❑Ubuntu: User-friendly and widely used, great for beginners. Based on Debian, with regular
updates and extensive community support.
❑ Debian: Known for its stability and extensive software repository. Often used as a base for
other distributions, including Ubuntu.
❑ Fedora: Features cutting-edge technology and software. Sponsored by Red Hat, it’s known for
its focus on innovation and security.
❑ CentOS: Community-supported, based on Red Hat Enterprise Linux (RHEL). Known for
stability and used in enterprise environments.
❑ Red Hat Enterprise Linux (RHEL): Commercially supported with enterprise-grade features and
support. Often used in business and server environments.
❑ openSUSE: Known for its versatility and strong administrative tools. Available in two versions:
Leap (stable) and Tumbleweed (rolling release).
❑ Arch Linux: Aimed at advanced users, it’s minimalist and highly customizable. Uses a
rolling release model and the Pacman package manager.
❑ Manjaro: Based on Arch Linux but more user-friendly, offering a simpler setup and pre-
configured desktop environments.
❑ Linux Mint: Based on Ubuntu, it provides a familiar and comfortable user experience
with a focus on ease of use and out-of-the-box functionality.
❑ Kali Linux: Specializes in penetration testing and security research, with a wide array of
pre-installed security tools.
❑ Gentoo: A source-based distribution for advanced users who want to optimize their
system for performance and customization.
❑ Slackware: One of the oldest distributions, known for its simplicity and minimalism,
providing a more hands-on approach to system management.
Pros of Linux( Advantages)
❑ Open Source: Free to use, modify, and distribute, with access to source code.
❑ Security: Strong built-in security features, including user permissions and SELinux.
❑ Stability: Reliable performance with minimal downtime.
❑ Customizability: Highly customizable to fit specific needs and preferences.
❑ Performance: Efficient use of system resources, often better performance on older
hardware.
❑ Community Support: Extensive community support and resources for troubleshooting
and advice.
❑ Multi-user Capability: Supports multiple users with different permissions and roles.
❑ Cost-effective: No licensing fees for the operating system or most applications.
Cons of Linux: (Disadvantages)
❑ Compatibility Issues: Limited support for some commercial software and
games.
❑ Learning Curve: Can be challenging for users unfamiliar with command-
line interfaces and Linux-specific commands.
❑ Hardware Support: May have less out-of-the-box support for certain
hardware compared to other operating systems.
❑ Software Availability: Some specialized software and drivers may not be
available or require additional configuration.
❑ Fragmentation: Various distributions and versions can lead to
inconsistencies and compatibility issues.
❑ Professional Support: While community support is strong, professional
support often requires a paid subscription or service.
LINUX DIRECTORY STRUCTURE
(FILE SYSTEM STRUCTURE)
1. / – ROOT
❑ Every single file and directory starts from the root directory.
❑ Only root user has write privilege under this directory.
❑ Please note that /root is root user’s home directory, which is not same as /.
2. /BIN – USER BINARIES
❑ Contains binary executables.
❑ Common linux commands you need to use in single-user modes are
located under this directory.
❑ Commands used by all the users of the system are located here.
❑ For example: ps, ls, ping, grep, cp.
3. /SBIN – SYSTEM BINARIES
❑ Just like /bin, /sbin also contains binary executables.
❑ But, the linux commands located under this directory are used typically
by system aministrator, for system maintenance purpose.
❑ For example: iptables, reboot, fdisk, ifconfig, swapon
4. /ETC – CONFIGURATION FILES
❑ Contains configuration files required by all programs.
❑ This also contains startup and shutdown shell scripts used to start/stop
individual programs.
❑ For example: /etc/resolv.conf, /etc/logrotate.conf
5. /DEV – DEVICE FILES
❑ Contains device files.
❑ These include terminal devices, usb, or any device attached to the
system.
❑ For example: /dev/tty1, /dev/usbmon0
6. /PROC – PROCESS INFORMATION
❑ Contains information about system process.
❑ This is a pseudo filesystem contains information about running
process. For example: /proc/{pid} directory contains information
about the process with that particular pid.
❑ This is a virtual filesystem with text information about system
resources. For example: /proc/uptime
(/proc/uptime This file contains two numbers: the uptime of the system
(seconds), and the amount of time spent in idle process (seconds). )
7. /VAR – VARIABLE FILES
❑ var stands for variable files.
❑ Content of the files that are expected to grow can be found under this
directory.
❑ This includes — system log files (/var/log); packages and database files
(/var/lib); emails (/var/mail); print queues (/var/spool); lock files
(/var/lock); temp files needed across reboots (/var/tmp);
8. /TMP – TEMPORARY FILES
❑ Directory that contains temporary files created by system and users.
❑ Files under this directory are deleted when system is rebooted.
9. /USR – USER PROGRAMS
▪ Contains binaries, libraries, documentation, and source-code for second level
programs.
▪ /usr/bin contains binary files for user programs. If you can’t find a user
binary under /bin, look under /usr/bin. For example: at, awk, cc, less, scp
▪ /usr/sbin contains binary files for system administrators. If you can’t find a
system binary under /sbin, look under /usr/sbin. For example: atd, cron,
sshd, useradd, userdel
▪ /usr/lib contains libraries for /usr/bin and /usr/sbin
▪ /usr/local contains users programs that you install from source. For example,
when you install apache from source, it goes under /usr/local/apache2
10. /HOME – HOME DIRECTORIES
❑ Home directories for all users to store their personal files.
❑ For example: /home/abc
11. /BOOT – BOOT LOADER FILES
❑ Contains boot loader related files.
❑ Kernel initrd, vmlinux, grub files are located under /boot
❑ For example: initrd.img-2.6.32-24-generic, vmlinuz-2.6.32-24-generic
12. /LIB – SYSTEM LIBRARIES
❑ Contains library files that supports the binaries located under /bin and /sbin
❑ Library filenames are either ld* or lib*.so.*
❑ For example: ld-2.11.1.so, libncurses.so.5.7
13. /OPT – OPTIONAL ADD-ON APPLICATIONS
❑ opt stands for optional.
❑ Contains add-on applications from individual vendors.
❑ add-on applications should be installed under either /opt/ or /opt/ sub-
directory.
14. /MNT – MOUNT DIRECTORY
❑Temporary mount directory where sysadmins can mount filesystems.
15. /MEDIA – REMOVABLE MEDIA DEVICES
❑ Temporary mount directory for removable devices.
❑ For examples, /media/cdrom for CD-ROM; /media/floppy for floppy
drives; /media/cdrecorder for CD writer
16. /SRV – SERVICE DATA
❑ srv stands for service.
❑ Contains server specific services related data.
❑ For example, /srv/cvs contains CVS related data.
Linux Administration
Linux is a major strength in computing technology. Most of the
webserver, mobile phones, personal computers, supercomputers,
and cloud-servers are powered by Linux. The job of a Linux
systems administrator is to manage the operations of a computer
system like maintain, enhance, create user account/report, taking
backups using Linux tools and command-line interface tools.
Most computing devices are powered by Linux because of its
high stability, high security, and open-source environment.
There are some of the things that a Linux system administrator should
know and understand:
❑ Linux File Systems
❑ File System Hierarchy
❑ Managing Root/super User
❑ Basic Bash Command
❑ Handling File, Directories and Users
Below are some duties of a Linux Administrator:
❑ Maintain all internet requests inclusive to DNS, RADIUS, Apache, MySQL, PHP.
❑ Taking regular back up of data, create new stored procedures and listing back-up is one of the duties.
❑ Analyzing all error logs and fixing along with providing excellent customer support for Webhosting, ISP and
LAN Customers on troubleshooting increased support troubles.
❑ Communicating with the staff, vendors, and customers in a cultivated, professional manner at all times has to
be one of his characteristics.
❑ Enhance, maintain and creating the tools for the Linux environment and its users.
❑ Detecting and solving the service problems ranging from disaster recovery to login problems.
❑ Installing the necessary systems and security tools. Working with the Data Network Engineer and other
personnel/departments to analyze hardware requirements and makes acquiring recommendations.
❑ Troubleshoot, when the problem occurs in the server.
Software Installation
One of the most difficult things to get used to in the Linux world is installing new software packages.
❑ In the world of Windows, every program comes with a Setup.exe program that asks you some very
easy questions and takes care of the job for you. While Linux software can be almost that easy to
install, you will sometimes find software that seems to fight every step of the way.
❑ Software tends to come in “packages”. In the Windows world a package is a Setup.exe or
a program.zip file. On a Mac a package is a program.dmg or a program.sit file. In the Linux world,
there are several kinds of packages, and each distribution has its own preferred package format.
❑ The standard Linux package format is RPM. RPM is a packaging system originally developed by
Red Hat and widely used in the Linux community.
❑ Distributions using it include Fedora, Mandriva, Red Hat (naturally), and SUSE.
❑ An RPM package file normally will be named something like program-version-other.rpm
❑ Another popular package format is DEB, the Debian software package. Debian packages and the
Advanced Packaging Tool (APT) were the first to introduce several advanced features that are
now common, such as automatic dependency resolution and signed packages. Debian packages
are used by Debian GNU/Linux (naturally), and distributions based on it, including Ubuntu,
Knoppix, and Mepis. A Debian package file normally will be named something like program-
version-other.deb
❑ Remember, you will need to become SuperUser to install software.
File and Directory Management
• ls: Lists files and directories in the current directory.
• cd [directory]: Changes the current directory to the specified directory.
• pwd: Displays the current working directory.
• mkdir [directory]: Creates a new directory.
• rmdir [directory]: Removes an empty directory.
• rm [file]: Removes a file.
• rm -r [directory]: Removes a directory and its contents recursively.
• cp [source] [destination]: Copies files or directories from the source to the destination.
• mv [source] [destination]: Moves or renames files or directories.
• touch [file]: Creates an empty file or updates the timestamp of an existing file.
Mounting and
Unmounting Devices
Introduction to Mounting
Mounting is the process of making a file system accessible in the
operating system. When you mount a device, such as a USB drive,
CD/DVD, or external hard disk, you are essentially attaching it to a
directory within the existing file system so that its contents can be
accessed by the operating system and the user.
✓ The mount command “mounts” a storage device or filesystem,
making it accessible and attaching it to an existing directory structure.
Introduction to Unmounting
Unmounting is the process of detaching the file system from the directory tree,
ensuring that all the data is properly written and the device is safe to remove.
Unmounting prevents data corruption and ensures that the file system is no longer
accessible.
✓ The umount command "unmounts" a mounted filesystem, informing the system to
complete any pending read or write operations, and safely detaching it.
How Mounting Works:
❖The operating system uses a directory, often referred to as a "mount
point," to represent the mounted device.
❖When a device is mounted, its file system is integrated into the
operating system's directory tree. For example, in Linux, devices are
typically mounted under /mnt or /media.
❖The file system on the device becomes part of the overall file
system hierarchy, allowing users to navigate into the directory
where the device is mounted and interact with the files on the
device as if they were part of the main file system.
User Administration
Users are accounts that can be used to login into a
system. Each user is identified by a unique identification
number or UID by the system.
❖ All the information of users in a system are stored in
/etc/passwd file.
❖ The hashed passwords for users are stored in
/etc/shadow file.
Users can be divided into two categories
on the basis of the level of access:
 Superuser/root/administrator : Access to all the files on the system.
 Normal users : Limited access.
When a new user is created, by default system takes following actions:
 Assigns UID to the user.
 Creates a home directory /home/.
 Sets the default shell of the user to be /bin/sh.
 Creates a private user group, named after the username itself.
 Contents of /etc/skel are copied to the home directory of the
new user.
 .bashrc, .bash_profile and .bash_logout are copied to the
home directory of new user.These files provide environment
variables for this user’s session.
Understanding Users and Groups:
•Users: Accounts created for individuals or services to
access the system. Each user has a unique username, user
ID (UID), home directory, and shell.
•Groups: Collections of users that share the same access
rights to files and directories. Groups help manage
permissions for multiple users at once.
User and Group Management Commands
➢ Create a New User
sudo useradd username
➢ Set a Password for a User
sudo passwd username
➢ Delete a User Account
sudo userdel username
➢ Delete User Account and Home Director
sudo userdel -r username
➢ List All Users
cat /etc/passwd
➢ Switch to Another User
su - username
➢ Create a New Group
sudo groupadd groupname
➢ Add a User to a Group
sudo usermod -aG groupname username
➢ Remove a User from a Group
sudo gpasswd -d username groupname
➢ Delete a Group
sudo groupdel groupname
➢ List All Groups
cat /etc/group
➢ list all the users that are members of a specific group
lid -g groupname
LINUX BOOT PROCESS
The 6 high level stages of a typical Linux boot process.
Boot Loader
A boot loader is a small program that is responsible for loading the
operating system (OS) into the computer's memory when the system is
powered on or restarted. The boot loader is a crucial part of the booting
process, as it bridges the gap between the system's firmware (such as BIOS
or UEFI- Unified Extensible Firmware Interface) and the OS. It initializes the OS and passes
control to it, allowing the system to start running.
The boot loader Key features include:
❑ GRUB (Grand Unified Bootloader): The most common Linux boot loader,
supporting multiple operating systems and configurations.
❑ Configuration Files: Uses files like /boot/grub/grub.cfg to define boot
options and kernel parameters.
❑ Menu Interface: Provides a menu to select different kernels or operating
systems during boot.
❑ Kernel Loading: Loads the Linux kernel into memory along with necessary
initial ramdisk (initrd) images.
❑ Boot Parameters: Allows passing of parameters to the kernel for
customization and troubleshooting.
inittab
inittab is a configuration file used by the init system in Unix-like
operating systems, particularly in older Linux distributions that
use SysVinit. It defines how the system initializes processes
and manages system runlevels.
Here are its key features of inittab:
❑ Runlevel Definitions: Specifies which processes should start or stop for each runlevel. Runlevels
are modes of operation (e.g., single-user mode, multi-user mode, etc.).
❑ Process Management: Lists system services and scripts that should run at various stages of the
boot process. This helps in managing system services based on the current runlevel.
❑ Automatic Execution: Defines actions to be taken automatically upon system boot or shutdown,
ensuring essential services are started or stopped correctly.
❑ Default Runlevel: Specifies the default runlevel that the system should enter after booting. This
determines the initial state of the system.
❑ System Initialization: Provides control over the initialization process, including executing scripts
and setting up environments required for various system operations.
rc.sysinit
rc.sysinit is a script used in the SysVinit system to
perform essential initialization tasks during the system
boot process. It is executed by the init process early in
the boot sequence.
Features of rc.sysinit
❑ System Initialization: Performs low-level system initialization tasks, such as setting up
environment variables and configuring system parameters.
❑ Filesystem Checks: Runs filesystem checks and repairs if needed, ensuring that the
filesystems are in a consistent state before mounting.
❑ Mounting Filesystems: Mounts essential filesystems required for the system to operate,
including root and other necessary filesystems.
❑ Loading Kernel Modules: Loads necessary kernel modules that are required for the system
hardware and drivers to function properly.
❑ Setting Up Networking: Configures network interfaces and other networking settings needed
for the system to communicate over the network.
❑ System Configuration: Executes additional scripts or commands to set up system-wide
configurations, such as local time settings and system locale.
In Linux, service controlling and daemons are fundamental for
managing system services and background processes.
Here’s a brief overview of their features:
Service Controlling
❑ Start/Stop/Restart Services: Allows administrators to start, stop, or restart system services as needed. This
can be done using commands like service or systemctl (for systemd systems).
❑ Status Monitoring: Provides the ability to check the current status of services, ensuring they are running or
not as expected.
❑ Configuration Management: Manages configuration files associated with services, allowing updates and
changes to service settings.
❑ Service Dependencies: Handles dependencies between services, ensuring that dependent services are
started or stopped in the correct order.
❑ Logging: Captures logs related to service activity, which can be useful for troubleshooting and monitoring
service performance.
Daemons
❑ Background Processes: Daemons are background processes that run independently of user
interactions, often starting at boot time and continuing to run until the system shuts down.
❑ Service Management: Daemons provide essential services to the system or other applications,
such as web servers, database servers, or print servers.
❑ Automatic Start: Many daemons are configured to start automatically at boot time, ensuring that
necessary services are available as soon as the system is up.
❑ Resource Handling: Daemons manage system resources, handle requests, and perform tasks
such as logging, network communication, or scheduled jobs.
❑ System Management: Daemons often include system management tasks, such as cron jobs for
scheduled tasks, or syslogd for logging system messages.
refers to a background process that runs continuously, independently of user interactions, to
perform system or application-level tasks. Daemons are essential for managing various
system functions and services.
Common Daemons in CentOS
❑ httpd: Handles HTTP requests for the Apache web server.
❑ sshd: Manages SSH connections for secure remote access.
❑ crond: Manages scheduled tasks defined in cron jobs.
❑ systemd: A system and service manager for CentOS that
controls how services and daemons are started, stopped,
and maintained.
Monitoring system
Monitoring a system's key components is essential for
maintaining optimal performance, troubleshooting
issues, and ensuring system reliability. The major areas
to monitor include CPU, RAM, HDD, modules, and
system logs. This material outlines key concepts, tools,
and techniques for monitoring these system aspects.
Monitoring CPU:(Central Processing Unit)
The CPU is the brain of a computer. Monitoring its usage is crucial for detecting bottlenecks,
managing workloads, and optimizing performance. Key metrics to monitor include:
❑ CPU Load: Measures the amount of work the CPU is doing. It's important to compare the
load against the number of cores/threads.
❑ CPU Utilization: The percentage of total CPU capacity being used.
❑ Temperature: Overheating can degrade CPU performance or damage hardware.
❑ Processes: Monitoring which processes consume the most CPU helps identify potential
issues.
❑ Linux Tools for CPU Monitoring: top, htop, mpstat, sar
Monitoring RAM
(Random Access Memory)
RAM is crucial for running applications smoothly. Monitoring RAM usage helps identify
memory leaks, inefficiencies, and the need for more memory.
❑ RAM Usage: Total and available memory should be monitored to prevent out-of-memory issues.
❑ Swap Memory: Swap usage indicates whether the system is compensating for insufficient RAM.
❑ Buffer/Cache Memory: These indicate the operating system’s attempt to optimize memory usage.
❑ Linux: free, vmstat, top, htop
Monitoring HDD (Hard Disk Drive)
Monitoring the hard disk helps prevent data loss, improve performance,
and avoid system crashes due to full disks. Key metrics include:
❑ Disk Usage: Monitor total, available, and used space to prevent the disk from filling up.
❑ Disk I/O (Input/Output): Measures the read and write operations. High disk I/O indicates heavy
disk activity, which could slow down performance.
❑ Disk Health: Monitor for bad sectors, disk temperature, and hardware failure predictions
(S.M.A.R.T data).
❑ Linux: df, du, iostat, smartctl
Monitoring Modules
Modules are system components that can be loaded into or unloaded
from the kernel dynamically. Monitoring modules helps ensure that all
required modules are loaded and functioning correctly.
❑ Loaded Modules: Track which modules are currently loaded and in use.
❑ Module Activity: Monitor the activity, performance, and health of each module to
ensure proper functionality.
❑ Module Dependencies: Check that required dependencies for each module are
present and functioning properly.
❑ Linux: lsmod, modinfo, dmesg
Monitoring Logs
Logs are critical for diagnosing system errors, auditing security, and
tracking system performance. Monitoring system logs can help detect
potential issues before they cause significant problems.
❑System Logs: Include kernel logs, system logs, and authentication
logs.
❑Application Logs: Monitoring logs of critical applications can provide
insights into their performance and issues.
❑Error Logs: Help diagnose problems like failed services, unauthorized
access attempts, or hardware failures.
❑Linux: journalctl, dmesg, syslog, logwatch
Linux Shell
THE LINUX SHELL IS A COMMAND-LINE INTERFACE (CLI) THAT
PROVIDES USERS WITH DIRECT COMMUNICATION WITH THE
OPERATING SYSTEM. IT INTERPRETS THE USER COMMANDS AND
CONVERTS THEM INTO ACTIONS THAT THE SYSTEM CAN EXECUTE.
UNLIKE GRAPHICAL USER INTERFACES (GUIS), THE SHELL ALLOWS
USERS TO INTERACT WITH THE SYSTEM USING TEXT COMMANDS.
Types of Shells in Linux
•Bash (Bourne Again Shell): The most widely used shell in Linux systems. It is an
enhancement of the original Bourne shell (sh) with additional features like command-
line editing, improved scripting capabilities, and more.
•Sh (Bourne Shell): One of the earliest shells, it serves as the foundation for many
modern shells.
•Zsh (Z Shell): An extended Bourne shell with many additional features, including
spell checking, advanced scripting, and better customization.
•Csh (C Shell): Similar to the C programming language syntax, it is suited for users
familiar with C-style languages.
•Tcsh: An enhanced version of C shell with additional features like command history
and job control.
Shell Command Categories
 File Management Commands
 Process Management Commands
 User Management Commands
 Networking Commands
File Management Commands:
❑ls: List directory contents.
❑cp: Copy files or directories.
❑mv: Move or rename files or directories.
❑rm: Remove files or directories.
❑touch: Create an empty file.
Process Management Commands:
❑ps: Display current running processes.
❑top: Monitor active processes in real-time.
❑kill: Terminate processes by PID.
❑bg and fg: Move processes to the background or foreground.
User Management Commands:
❑whoami: Show the current user.
❑su: Switch to another user.
❑passwd: Change the user password.
Networking Commands:
❑ping: Check the network connectivity.
❑ifconfig: Display or configure network interfaces.
❑wget: Download files from the internet.
LFS all in one123456789012334455678 .pdf

LFS all in one123456789012334455678 .pdf

  • 1.
    ➢ 1991 -Linux Kernel: The first Linux kernel was released by Linus Torvalds on September 17, 1991. ➢ 1992 - Yggdrasil Linux/GNU/X: One of the earliest Linux distributions, Yggdrasil was first released in December 1992. ➢ 1993 – Slackware: one of the oldest distributions still active today, was first released on July 16, 1993. ➢ 1993 – Debian: was announced by Ian Murdock on August 16, 1993, and remains a foundational distribution for many others. ➢ 1994 - Red Hat Linux: The first official release of Red Hat Linux was in May 1995, after beta releases in late 1994. ➢ 1994 - SUSE Linux:Originally a derivative of Slackware, SUSE Linux was first released in 1994. ➢ 1996 - Caldera OpenLinux: was introduced in 1996 and was one of the first distributions aimed at businesses. ➢ 1998 - Mandrake Linux: Mandrake Linux, based on Red Hat, was first released in July 1998. It was later rebranded as Mandriva. ➢ 2000 – Knoppix: known for being a live CD distribution, was first released in 2000. ➢ 2000 - Gentoo Linux: known for its customization and source-based package management, was first released in 2002, though development started in 2000. ➢ 2002 - Arch Linux: a lightweight and flexible distribution, was first released in March 2002. ➢ 2003 – Fedora: was first released on November 6, 2003, as the community-supported successor to Red Hat Linux. ➢ 2004 – Ubuntu: based on Debian, was first released on October 20, 2004, and became widely popular for its ease of use. ➢ 2006 - Linux Mint: was first released in August 2006, based on Ubuntu, with a focus on providing a user-friendly desktop experience. ➢ 2007 - Puppy Linux: known for its small size and fast performance, was first released in 2003, but gained broader attention with its 2007 release. ➢ 2009 – Chakra: initially derived from Arch Linux, was first released in 2009, focusing on a KDE desktop environment. ➢ 2011 – Mageia: was forked from Mandriva Linux and first released in September 2010, with the stable version arriving in June 2011.
  • 2.
    ➢ 2012 -Elementary OS: known for its beautiful design and user-friendly interface, was first released in 2012. ➢ 2013 – Manjaro: based on Arch Linux, was first released in July 2013, aiming to provide a more accessible version of Arch. ➢ 2015 – Solus: a distribution built from scratch with a focus on desktop usability, was first released in December 2015. ➢ 2017 - Pop!_OS: developed by System76, was first released in October 2017, and is known for being optimized for their hardware and providing a great out-of-the-box experience. ➢ 2020 - Zorin OS: focused on providing a Windows-like experience for newcomers to Linux, released its first version in 2008, but gained significant attention with its 2020 releases. ➢ 2021 – AlmaLinux: was released in March 2021 as a community-driven fork of CentOS, aimed at providing a free and open-source RHEL-compatible distribution. ➢ 2021 - Rocky Linux: another RHEL-compatible distribution, was released in June 2021, founded by the original CentOS creator Gregory Kurtzer. ➢ 2022 - SteamOS 3.0: a Linux distribution developed by Valve Corporation for their Steam Deck handheld gaming device, was released in 2022. ➢ 2023 - Vanilla OS: was launched in December 2022, gaining more traction in 2023. It is an immutable OS based on Ubuntu, with a focus on stability and security. ➢ 2024 - Nobara Project: a Fedora-based distribution tailored for gamers, content creators, and Linux newcomers, was created by developer GloriousEggroll, and gained attention in 2023-2024.
  • 3.
    Linux Features • Multiusercapability: Multiple users can access the same system resources like memory, hard disk, etc. But they have to use different terminals to operate. • Multitasking: More than one function can be performed simultaneously by dividing the CPU time intelligently. • Portability: Portability doesn't mean it is smaller in file size or can be carried in pen drives or memory cards. It means that it support different types of hardware. • Security: It provides security in three ways namely authenticating (by assigning password and login ID), authorization (by assigning permission to read, write and execute) and encryption (converts file into an unreadable format). • Live CD/USB: Almost all Linux distros provide live CD/USB so that users can run/try it without installing it. • Graphical User Interface (X Window system): Linux is command line based OS but it can be converted to GUI based by installing packages. • Support's customized keyboard: As it is used worldwide, hence supports different languages keyboards. • Application support: It has its own software repository from where users can download and install many applications. • File System: Provides hierarchical file system in which files and directories are arranged. • Open Source: Linux code is freely available to all and is a community based development project.
  • 4.
    Feature Linux Windows SourceCode Open Source Closed Source Licensing Typically licensed under GNU GPL Proprietary, requires purchase of a license User Interface Highly customizable with various desktop environments Standardized interface with limited customization Distributions Numerous distributions (e.g., Ubuntu, Fedora, Arch, etc.) Single distribution controlled by Microsoft Software Installation Package managers (e.g., APT, YUM, DNF) Executable files (.exe) and Microsoft Store Software Availability Extensive open-source software, limited proprietary software Wide range of commercial and proprietary software Security Strong security model, less targeted by malware Improved security, but more frequently targeted by malware Performance Efficient, can run on a wide range of hardware Resource-intensive, performs best on modern hardware System Requirements Can run on low-resource or older systems Typically requires more resources, especially with newer versions Command Line Interface Command line is central, offers powerful control GUI-focused, command line (CMD/PowerShell) less commonly used Community Support Large, active community with extensive forums and documentation Official support from Microsoft, with online resources Updates and Upgrades User-controlled updates, distributions may have rolling releases Automatic updates, major upgrades require a new license/version Customization Highly customizable, from kernel to desktop environment Limited customization options Use Cases Preferred for servers, development, programming, and customization Widely used in business, gaming, and general- purpose computing
  • 5.
    Feature Linux Unix OriginCreated by Linus Torvalds in 1991 Developed at AT&T's Bell Labs in the early 1970s Source Code Open Source, freely available Mostly proprietary, with some open-source variants (e.g., BSD) Licensing GNU General Public License (GPL) Commercial licenses, with exceptions like BSD's open license Development Model Community-driven, with contributions from individuals and corporations Corporate-driven, typically by the owning company Distributions Numerous distributions (e.g., Ubuntu, Red Hat, Debian) Multiple proprietary versions (e.g., AIX, HP-UX, Solaris) Kernel Monolithic Linux kernel Typically monolithic, but varies by implementation User Interface Variety of desktop environments and user interfaces Commonly uses command-line interface (CLI), though some versions have GUIs System Usage Widely used in servers, desktops, embedded systems, and development environments Primarily used in enterprise servers, workstations, and mainframes Customization Highly customizable at both kernel and user interface levels Customizable, but generally requires more expertise and may be limited by the proprietary nature Security Strong security features, with active community support Strong security, often used in critical enterprise environments Hardware Compatibility Supports a wide range of hardware, including x86, ARM, and more Typically supports specific, high-end hardware systems Updates and Upgrades Frequent updates, user-controlled, with rolling-release options Updates are controlled by the vendor, often with a focus on stability Market Share Dominant in web servers, cloud infrastructure, and supercomputing Predominantly used in enterprise environments, with declining use outside of niche markets Community Support Large, active community with extensive forums and documentation Smaller, specialized community, often dependent on vendor support Commercial Support Available from companies like Red Hat, Canonical, and SUSE Provided by the vendor (e.g., IBM for AIX, Oracle for Solaris)
  • 6.
    GNU The GNU operatingsystem is a complete free software system, upward-compatible with Unix. GNU stands for “GNU's Not Unix”. It is pronounced as one syllable with a hard g. Richard Stallman made the Initial Announcement of the GNU Project in September 1983. A longer version called the GNU Manifesto was published in March 1985. It has been translated into several other languages. The word “free” in “free software” pertains to freedom, not price. You may or may not pay a price to get GNU software. Either way, once you have the software you have four specific freedoms in using it. • The freedom to run the program as you wish; • The freedom to copy the program and give it away to your friends and co-workers; • The freedom to change the program as you wish, by having full access to source code • The freedom to distribute an improved version and thus help build the community.
  • 7.
    Virus free Linux ❑Linux Security: Linux is architecturally robust and generally secure against threats, though not completely immune. Scripts written for RPM-based systems (like RedHat) can't infect Debian-based systems, and system- wide changes require root access. A strong root password enhances security. ❑ Password Requirement: Linux requires passwords for all users except 'Guest,' unlike Windows, which can have accounts without passwords. ❑ Program Permissions: In Linux, programs require permission (sudo) or root access to install or uninstall, whereas Windows programs can be managed without administrator consent. ❑ GUI vs. CLI: Linux can operate effectively without a GUI, which is often disabled by administrators for security. Windows requires a GUI to function. ❑ Firewall and SELinux: Linux's Security-Enhanced Linux (SELinux) provides robust access control and security policies. While SELinux is not mandatory for normal use, it's crucial for network users and administrators. ❑ Antivirus and Encryption: Install Clam AV for additional protection on networked systems. You can also encrypt disks, use a boot loader password, and set custom user roles.
  • 8.
    Linux Distributions (Distros): ❑Ubuntu:User-friendly and widely used, great for beginners. Based on Debian, with regular updates and extensive community support. ❑ Debian: Known for its stability and extensive software repository. Often used as a base for other distributions, including Ubuntu. ❑ Fedora: Features cutting-edge technology and software. Sponsored by Red Hat, it’s known for its focus on innovation and security. ❑ CentOS: Community-supported, based on Red Hat Enterprise Linux (RHEL). Known for stability and used in enterprise environments. ❑ Red Hat Enterprise Linux (RHEL): Commercially supported with enterprise-grade features and support. Often used in business and server environments. ❑ openSUSE: Known for its versatility and strong administrative tools. Available in two versions: Leap (stable) and Tumbleweed (rolling release).
  • 9.
    ❑ Arch Linux:Aimed at advanced users, it’s minimalist and highly customizable. Uses a rolling release model and the Pacman package manager. ❑ Manjaro: Based on Arch Linux but more user-friendly, offering a simpler setup and pre- configured desktop environments. ❑ Linux Mint: Based on Ubuntu, it provides a familiar and comfortable user experience with a focus on ease of use and out-of-the-box functionality. ❑ Kali Linux: Specializes in penetration testing and security research, with a wide array of pre-installed security tools. ❑ Gentoo: A source-based distribution for advanced users who want to optimize their system for performance and customization. ❑ Slackware: One of the oldest distributions, known for its simplicity and minimalism, providing a more hands-on approach to system management.
  • 10.
    Pros of Linux(Advantages) ❑ Open Source: Free to use, modify, and distribute, with access to source code. ❑ Security: Strong built-in security features, including user permissions and SELinux. ❑ Stability: Reliable performance with minimal downtime. ❑ Customizability: Highly customizable to fit specific needs and preferences. ❑ Performance: Efficient use of system resources, often better performance on older hardware. ❑ Community Support: Extensive community support and resources for troubleshooting and advice. ❑ Multi-user Capability: Supports multiple users with different permissions and roles. ❑ Cost-effective: No licensing fees for the operating system or most applications.
  • 11.
    Cons of Linux:(Disadvantages) ❑ Compatibility Issues: Limited support for some commercial software and games. ❑ Learning Curve: Can be challenging for users unfamiliar with command- line interfaces and Linux-specific commands. ❑ Hardware Support: May have less out-of-the-box support for certain hardware compared to other operating systems. ❑ Software Availability: Some specialized software and drivers may not be available or require additional configuration. ❑ Fragmentation: Various distributions and versions can lead to inconsistencies and compatibility issues. ❑ Professional Support: While community support is strong, professional support often requires a paid subscription or service.
  • 12.
  • 14.
    1. / –ROOT ❑ Every single file and directory starts from the root directory. ❑ Only root user has write privilege under this directory. ❑ Please note that /root is root user’s home directory, which is not same as /.
  • 15.
    2. /BIN –USER BINARIES ❑ Contains binary executables. ❑ Common linux commands you need to use in single-user modes are located under this directory. ❑ Commands used by all the users of the system are located here. ❑ For example: ps, ls, ping, grep, cp.
  • 16.
    3. /SBIN –SYSTEM BINARIES ❑ Just like /bin, /sbin also contains binary executables. ❑ But, the linux commands located under this directory are used typically by system aministrator, for system maintenance purpose. ❑ For example: iptables, reboot, fdisk, ifconfig, swapon
  • 17.
    4. /ETC –CONFIGURATION FILES ❑ Contains configuration files required by all programs. ❑ This also contains startup and shutdown shell scripts used to start/stop individual programs. ❑ For example: /etc/resolv.conf, /etc/logrotate.conf
  • 18.
    5. /DEV –DEVICE FILES ❑ Contains device files. ❑ These include terminal devices, usb, or any device attached to the system. ❑ For example: /dev/tty1, /dev/usbmon0
  • 19.
    6. /PROC –PROCESS INFORMATION ❑ Contains information about system process. ❑ This is a pseudo filesystem contains information about running process. For example: /proc/{pid} directory contains information about the process with that particular pid. ❑ This is a virtual filesystem with text information about system resources. For example: /proc/uptime (/proc/uptime This file contains two numbers: the uptime of the system (seconds), and the amount of time spent in idle process (seconds). )
  • 20.
    7. /VAR –VARIABLE FILES ❑ var stands for variable files. ❑ Content of the files that are expected to grow can be found under this directory. ❑ This includes — system log files (/var/log); packages and database files (/var/lib); emails (/var/mail); print queues (/var/spool); lock files (/var/lock); temp files needed across reboots (/var/tmp);
  • 21.
    8. /TMP –TEMPORARY FILES ❑ Directory that contains temporary files created by system and users. ❑ Files under this directory are deleted when system is rebooted.
  • 22.
    9. /USR –USER PROGRAMS ▪ Contains binaries, libraries, documentation, and source-code for second level programs. ▪ /usr/bin contains binary files for user programs. If you can’t find a user binary under /bin, look under /usr/bin. For example: at, awk, cc, less, scp ▪ /usr/sbin contains binary files for system administrators. If you can’t find a system binary under /sbin, look under /usr/sbin. For example: atd, cron, sshd, useradd, userdel ▪ /usr/lib contains libraries for /usr/bin and /usr/sbin ▪ /usr/local contains users programs that you install from source. For example, when you install apache from source, it goes under /usr/local/apache2
  • 23.
    10. /HOME –HOME DIRECTORIES ❑ Home directories for all users to store their personal files. ❑ For example: /home/abc
  • 24.
    11. /BOOT –BOOT LOADER FILES ❑ Contains boot loader related files. ❑ Kernel initrd, vmlinux, grub files are located under /boot ❑ For example: initrd.img-2.6.32-24-generic, vmlinuz-2.6.32-24-generic
  • 25.
    12. /LIB –SYSTEM LIBRARIES ❑ Contains library files that supports the binaries located under /bin and /sbin ❑ Library filenames are either ld* or lib*.so.* ❑ For example: ld-2.11.1.so, libncurses.so.5.7
  • 26.
    13. /OPT –OPTIONAL ADD-ON APPLICATIONS ❑ opt stands for optional. ❑ Contains add-on applications from individual vendors. ❑ add-on applications should be installed under either /opt/ or /opt/ sub- directory.
  • 27.
    14. /MNT –MOUNT DIRECTORY ❑Temporary mount directory where sysadmins can mount filesystems.
  • 28.
    15. /MEDIA –REMOVABLE MEDIA DEVICES ❑ Temporary mount directory for removable devices. ❑ For examples, /media/cdrom for CD-ROM; /media/floppy for floppy drives; /media/cdrecorder for CD writer
  • 29.
    16. /SRV –SERVICE DATA ❑ srv stands for service. ❑ Contains server specific services related data. ❑ For example, /srv/cvs contains CVS related data.
  • 35.
  • 36.
    Linux is amajor strength in computing technology. Most of the webserver, mobile phones, personal computers, supercomputers, and cloud-servers are powered by Linux. The job of a Linux systems administrator is to manage the operations of a computer system like maintain, enhance, create user account/report, taking backups using Linux tools and command-line interface tools. Most computing devices are powered by Linux because of its high stability, high security, and open-source environment.
  • 37.
    There are someof the things that a Linux system administrator should know and understand: ❑ Linux File Systems ❑ File System Hierarchy ❑ Managing Root/super User ❑ Basic Bash Command ❑ Handling File, Directories and Users
  • 38.
    Below are someduties of a Linux Administrator: ❑ Maintain all internet requests inclusive to DNS, RADIUS, Apache, MySQL, PHP. ❑ Taking regular back up of data, create new stored procedures and listing back-up is one of the duties. ❑ Analyzing all error logs and fixing along with providing excellent customer support for Webhosting, ISP and LAN Customers on troubleshooting increased support troubles. ❑ Communicating with the staff, vendors, and customers in a cultivated, professional manner at all times has to be one of his characteristics. ❑ Enhance, maintain and creating the tools for the Linux environment and its users. ❑ Detecting and solving the service problems ranging from disaster recovery to login problems. ❑ Installing the necessary systems and security tools. Working with the Data Network Engineer and other personnel/departments to analyze hardware requirements and makes acquiring recommendations. ❑ Troubleshoot, when the problem occurs in the server.
  • 39.
    Software Installation One ofthe most difficult things to get used to in the Linux world is installing new software packages. ❑ In the world of Windows, every program comes with a Setup.exe program that asks you some very easy questions and takes care of the job for you. While Linux software can be almost that easy to install, you will sometimes find software that seems to fight every step of the way. ❑ Software tends to come in “packages”. In the Windows world a package is a Setup.exe or a program.zip file. On a Mac a package is a program.dmg or a program.sit file. In the Linux world, there are several kinds of packages, and each distribution has its own preferred package format. ❑ The standard Linux package format is RPM. RPM is a packaging system originally developed by Red Hat and widely used in the Linux community. ❑ Distributions using it include Fedora, Mandriva, Red Hat (naturally), and SUSE. ❑ An RPM package file normally will be named something like program-version-other.rpm ❑ Another popular package format is DEB, the Debian software package. Debian packages and the Advanced Packaging Tool (APT) were the first to introduce several advanced features that are now common, such as automatic dependency resolution and signed packages. Debian packages are used by Debian GNU/Linux (naturally), and distributions based on it, including Ubuntu, Knoppix, and Mepis. A Debian package file normally will be named something like program- version-other.deb ❑ Remember, you will need to become SuperUser to install software.
  • 40.
    File and DirectoryManagement • ls: Lists files and directories in the current directory. • cd [directory]: Changes the current directory to the specified directory. • pwd: Displays the current working directory. • mkdir [directory]: Creates a new directory. • rmdir [directory]: Removes an empty directory. • rm [file]: Removes a file. • rm -r [directory]: Removes a directory and its contents recursively. • cp [source] [destination]: Copies files or directories from the source to the destination. • mv [source] [destination]: Moves or renames files or directories. • touch [file]: Creates an empty file or updates the timestamp of an existing file.
  • 41.
  • 42.
    Introduction to Mounting Mountingis the process of making a file system accessible in the operating system. When you mount a device, such as a USB drive, CD/DVD, or external hard disk, you are essentially attaching it to a directory within the existing file system so that its contents can be accessed by the operating system and the user. ✓ The mount command “mounts” a storage device or filesystem, making it accessible and attaching it to an existing directory structure.
  • 43.
    Introduction to Unmounting Unmountingis the process of detaching the file system from the directory tree, ensuring that all the data is properly written and the device is safe to remove. Unmounting prevents data corruption and ensures that the file system is no longer accessible. ✓ The umount command "unmounts" a mounted filesystem, informing the system to complete any pending read or write operations, and safely detaching it.
  • 44.
    How Mounting Works: ❖Theoperating system uses a directory, often referred to as a "mount point," to represent the mounted device. ❖When a device is mounted, its file system is integrated into the operating system's directory tree. For example, in Linux, devices are typically mounted under /mnt or /media. ❖The file system on the device becomes part of the overall file system hierarchy, allowing users to navigate into the directory where the device is mounted and interact with the files on the device as if they were part of the main file system.
  • 45.
  • 46.
    Users are accountsthat can be used to login into a system. Each user is identified by a unique identification number or UID by the system. ❖ All the information of users in a system are stored in /etc/passwd file. ❖ The hashed passwords for users are stored in /etc/shadow file.
  • 47.
    Users can bedivided into two categories on the basis of the level of access:  Superuser/root/administrator : Access to all the files on the system.  Normal users : Limited access.
  • 48.
    When a newuser is created, by default system takes following actions:  Assigns UID to the user.  Creates a home directory /home/.  Sets the default shell of the user to be /bin/sh.  Creates a private user group, named after the username itself.  Contents of /etc/skel are copied to the home directory of the new user.  .bashrc, .bash_profile and .bash_logout are copied to the home directory of new user.These files provide environment variables for this user’s session.
  • 49.
    Understanding Users andGroups: •Users: Accounts created for individuals or services to access the system. Each user has a unique username, user ID (UID), home directory, and shell. •Groups: Collections of users that share the same access rights to files and directories. Groups help manage permissions for multiple users at once.
  • 50.
    User and GroupManagement Commands ➢ Create a New User sudo useradd username ➢ Set a Password for a User sudo passwd username ➢ Delete a User Account sudo userdel username ➢ Delete User Account and Home Director sudo userdel -r username ➢ List All Users cat /etc/passwd ➢ Switch to Another User su - username ➢ Create a New Group sudo groupadd groupname ➢ Add a User to a Group sudo usermod -aG groupname username ➢ Remove a User from a Group sudo gpasswd -d username groupname ➢ Delete a Group sudo groupdel groupname ➢ List All Groups cat /etc/group ➢ list all the users that are members of a specific group lid -g groupname
  • 51.
  • 52.
    The 6 highlevel stages of a typical Linux boot process.
  • 53.
    Boot Loader A bootloader is a small program that is responsible for loading the operating system (OS) into the computer's memory when the system is powered on or restarted. The boot loader is a crucial part of the booting process, as it bridges the gap between the system's firmware (such as BIOS or UEFI- Unified Extensible Firmware Interface) and the OS. It initializes the OS and passes control to it, allowing the system to start running.
  • 54.
    The boot loaderKey features include: ❑ GRUB (Grand Unified Bootloader): The most common Linux boot loader, supporting multiple operating systems and configurations. ❑ Configuration Files: Uses files like /boot/grub/grub.cfg to define boot options and kernel parameters. ❑ Menu Interface: Provides a menu to select different kernels or operating systems during boot. ❑ Kernel Loading: Loads the Linux kernel into memory along with necessary initial ramdisk (initrd) images. ❑ Boot Parameters: Allows passing of parameters to the kernel for customization and troubleshooting.
  • 55.
    inittab inittab is aconfiguration file used by the init system in Unix-like operating systems, particularly in older Linux distributions that use SysVinit. It defines how the system initializes processes and manages system runlevels.
  • 56.
    Here are itskey features of inittab: ❑ Runlevel Definitions: Specifies which processes should start or stop for each runlevel. Runlevels are modes of operation (e.g., single-user mode, multi-user mode, etc.). ❑ Process Management: Lists system services and scripts that should run at various stages of the boot process. This helps in managing system services based on the current runlevel. ❑ Automatic Execution: Defines actions to be taken automatically upon system boot or shutdown, ensuring essential services are started or stopped correctly. ❑ Default Runlevel: Specifies the default runlevel that the system should enter after booting. This determines the initial state of the system. ❑ System Initialization: Provides control over the initialization process, including executing scripts and setting up environments required for various system operations.
  • 57.
    rc.sysinit rc.sysinit is ascript used in the SysVinit system to perform essential initialization tasks during the system boot process. It is executed by the init process early in the boot sequence.
  • 58.
    Features of rc.sysinit ❑System Initialization: Performs low-level system initialization tasks, such as setting up environment variables and configuring system parameters. ❑ Filesystem Checks: Runs filesystem checks and repairs if needed, ensuring that the filesystems are in a consistent state before mounting. ❑ Mounting Filesystems: Mounts essential filesystems required for the system to operate, including root and other necessary filesystems. ❑ Loading Kernel Modules: Loads necessary kernel modules that are required for the system hardware and drivers to function properly. ❑ Setting Up Networking: Configures network interfaces and other networking settings needed for the system to communicate over the network. ❑ System Configuration: Executes additional scripts or commands to set up system-wide configurations, such as local time settings and system locale.
  • 59.
    In Linux, servicecontrolling and daemons are fundamental for managing system services and background processes. Here’s a brief overview of their features: Service Controlling ❑ Start/Stop/Restart Services: Allows administrators to start, stop, or restart system services as needed. This can be done using commands like service or systemctl (for systemd systems). ❑ Status Monitoring: Provides the ability to check the current status of services, ensuring they are running or not as expected. ❑ Configuration Management: Manages configuration files associated with services, allowing updates and changes to service settings. ❑ Service Dependencies: Handles dependencies between services, ensuring that dependent services are started or stopped in the correct order. ❑ Logging: Captures logs related to service activity, which can be useful for troubleshooting and monitoring service performance.
  • 60.
    Daemons ❑ Background Processes:Daemons are background processes that run independently of user interactions, often starting at boot time and continuing to run until the system shuts down. ❑ Service Management: Daemons provide essential services to the system or other applications, such as web servers, database servers, or print servers. ❑ Automatic Start: Many daemons are configured to start automatically at boot time, ensuring that necessary services are available as soon as the system is up. ❑ Resource Handling: Daemons manage system resources, handle requests, and perform tasks such as logging, network communication, or scheduled jobs. ❑ System Management: Daemons often include system management tasks, such as cron jobs for scheduled tasks, or syslogd for logging system messages. refers to a background process that runs continuously, independently of user interactions, to perform system or application-level tasks. Daemons are essential for managing various system functions and services.
  • 61.
    Common Daemons inCentOS ❑ httpd: Handles HTTP requests for the Apache web server. ❑ sshd: Manages SSH connections for secure remote access. ❑ crond: Manages scheduled tasks defined in cron jobs. ❑ systemd: A system and service manager for CentOS that controls how services and daemons are started, stopped, and maintained.
  • 62.
    Monitoring system Monitoring asystem's key components is essential for maintaining optimal performance, troubleshooting issues, and ensuring system reliability. The major areas to monitor include CPU, RAM, HDD, modules, and system logs. This material outlines key concepts, tools, and techniques for monitoring these system aspects.
  • 63.
    Monitoring CPU:(Central ProcessingUnit) The CPU is the brain of a computer. Monitoring its usage is crucial for detecting bottlenecks, managing workloads, and optimizing performance. Key metrics to monitor include: ❑ CPU Load: Measures the amount of work the CPU is doing. It's important to compare the load against the number of cores/threads. ❑ CPU Utilization: The percentage of total CPU capacity being used. ❑ Temperature: Overheating can degrade CPU performance or damage hardware. ❑ Processes: Monitoring which processes consume the most CPU helps identify potential issues. ❑ Linux Tools for CPU Monitoring: top, htop, mpstat, sar
  • 64.
    Monitoring RAM (Random AccessMemory) RAM is crucial for running applications smoothly. Monitoring RAM usage helps identify memory leaks, inefficiencies, and the need for more memory. ❑ RAM Usage: Total and available memory should be monitored to prevent out-of-memory issues. ❑ Swap Memory: Swap usage indicates whether the system is compensating for insufficient RAM. ❑ Buffer/Cache Memory: These indicate the operating system’s attempt to optimize memory usage. ❑ Linux: free, vmstat, top, htop
  • 65.
    Monitoring HDD (HardDisk Drive) Monitoring the hard disk helps prevent data loss, improve performance, and avoid system crashes due to full disks. Key metrics include: ❑ Disk Usage: Monitor total, available, and used space to prevent the disk from filling up. ❑ Disk I/O (Input/Output): Measures the read and write operations. High disk I/O indicates heavy disk activity, which could slow down performance. ❑ Disk Health: Monitor for bad sectors, disk temperature, and hardware failure predictions (S.M.A.R.T data). ❑ Linux: df, du, iostat, smartctl
  • 66.
    Monitoring Modules Modules aresystem components that can be loaded into or unloaded from the kernel dynamically. Monitoring modules helps ensure that all required modules are loaded and functioning correctly. ❑ Loaded Modules: Track which modules are currently loaded and in use. ❑ Module Activity: Monitor the activity, performance, and health of each module to ensure proper functionality. ❑ Module Dependencies: Check that required dependencies for each module are present and functioning properly. ❑ Linux: lsmod, modinfo, dmesg
  • 67.
    Monitoring Logs Logs arecritical for diagnosing system errors, auditing security, and tracking system performance. Monitoring system logs can help detect potential issues before they cause significant problems. ❑System Logs: Include kernel logs, system logs, and authentication logs. ❑Application Logs: Monitoring logs of critical applications can provide insights into their performance and issues. ❑Error Logs: Help diagnose problems like failed services, unauthorized access attempts, or hardware failures. ❑Linux: journalctl, dmesg, syslog, logwatch
  • 68.
    Linux Shell THE LINUXSHELL IS A COMMAND-LINE INTERFACE (CLI) THAT PROVIDES USERS WITH DIRECT COMMUNICATION WITH THE OPERATING SYSTEM. IT INTERPRETS THE USER COMMANDS AND CONVERTS THEM INTO ACTIONS THAT THE SYSTEM CAN EXECUTE. UNLIKE GRAPHICAL USER INTERFACES (GUIS), THE SHELL ALLOWS USERS TO INTERACT WITH THE SYSTEM USING TEXT COMMANDS.
  • 70.
    Types of Shellsin Linux •Bash (Bourne Again Shell): The most widely used shell in Linux systems. It is an enhancement of the original Bourne shell (sh) with additional features like command- line editing, improved scripting capabilities, and more. •Sh (Bourne Shell): One of the earliest shells, it serves as the foundation for many modern shells. •Zsh (Z Shell): An extended Bourne shell with many additional features, including spell checking, advanced scripting, and better customization. •Csh (C Shell): Similar to the C programming language syntax, it is suited for users familiar with C-style languages. •Tcsh: An enhanced version of C shell with additional features like command history and job control.
  • 71.
    Shell Command Categories File Management Commands  Process Management Commands  User Management Commands  Networking Commands
  • 72.
    File Management Commands: ❑ls:List directory contents. ❑cp: Copy files or directories. ❑mv: Move or rename files or directories. ❑rm: Remove files or directories. ❑touch: Create an empty file.
  • 73.
    Process Management Commands: ❑ps:Display current running processes. ❑top: Monitor active processes in real-time. ❑kill: Terminate processes by PID. ❑bg and fg: Move processes to the background or foreground.
  • 74.
    User Management Commands: ❑whoami:Show the current user. ❑su: Switch to another user. ❑passwd: Change the user password.
  • 75.
    Networking Commands: ❑ping: Checkthe network connectivity. ❑ifconfig: Display or configure network interfaces. ❑wget: Download files from the internet.