SlideShare a Scribd company logo
DevOps Essentials and Pre-
requisites
Presented by Mohamed Ramadan
6/22/2024 1
Recap
1- What is DevOps
2- Could you please explain CICD
Content
1- Introduction to Linux
2- Useful Linux Commands
3- Introduction to Bash Scripting
Introduction to Linux
What is Linux ?
Linux is a powerful and flexible family of operating systems that are free to use and share. It was created by a person named
Linus Torvalds in 1991. What’s cool is that anyone can see how the system works because its source code is open for everyone
to explore and modify. This openness encourages people from all over the world to work together and make Linux better and
better. Since its beginning, Linux has grown into a stable and safe system used in many different things, like computers,
smartphones, and big supercomputers. It’s known for being efficient, meaning it can do a lot of tasks quickly, and it’s also cost-
effective, which means it doesn’t cost a lot to use.
Linux Distributions and Differences:
● Ubuntu: Known for its ease of use and community support.
● Debian: Emphasizes stability and free software principles.
● Fedora: Often used for cutting-edge features and technologies.
● CentOS/RHEL (Red Hat Enterprise Linux): Known for stability and widely used in enterprise environments.
● Arch Linux: Follows a rolling release model and is highly customizable.
● openSUSE: Known for its YaST configuration tool and flexibility.
● Linux Mint: Focuses on user-friendliness and multimedia support.
Note:
The differences among distributions primarily lie in package management systems, default desktop environments,
release cycles, and system administration tools.
Linux Scope for DevOps:
● Scripting and Automation: Bash and other scripting languages are integral to automating repetitive tasks.
● Containerization: Linux is the foundation for container technologies like Docker and Kubernetes.
● Configuration Management: Tools like Ansible, Puppet, and Chef are widely used on Linux systems.
● Version Control: Git, a distributed version control system, is essential in DevOps workflows and is platform-independent.
● Cloud Computing: Many cloud platforms, such as AWS and Azure, run on Linux servers.
Architecture of Linux
• Kernel: Kernel is the core of the Linux based operating system. It virtualizes the common
hardware resources of the computer to provide each process with its virtual resources. This
makes the process seem as if it is the sole process running on the machine. The kernel is
also responsible for preventing and mitigating conflicts between different processes.
• System Library:Linux uses system libraries, also known as shared libraries, to implement
various functionalities of the operating system. These libraries contain pre-written code
that applications can use to perform specific tasks. By using these libraries, developers can
save time and effort, as they don’t need to write the same code repeatedly. System libraries
act as an interface between applications and the kernel, providing a standardized and
efficient way for applications to interact with the underlying system.
• Shell:The shell is the user interface of the Linux Operating System. It allows users to
interact with the system by entering commands, which the shell interprets and executes.
The shell serves as a bridge between the user and the kernel, forwarding the user’s
requests to the kernel for processing. It provides a convenient way for users to perform
various tasks, such as running programs, managing files, and configuring the system.
• Hardware Layer: The hardware layer encompasses all the physical components of the
computer, such as RAM (Random Access Memory), HDD (Hard Disk Drive), CPU (Central
Processing Unit), and input/output devices. This layer is responsible for interacting with the
Linux Operating System and providing the necessary resources for the system and
applications to function properly. The Linux kernel and system libraries enable
communication and control over these hardware components, ensuring that they work
harmoniously together.
• System Utility: System utilities are essential tools and programs provided by the Linux
Operating System to manage and configure various aspects of the system. These utilities
perform tasks such as installing software, configuring network settings, monitoring system
performance, managing users and permissions, and much more. System utilities simplify
system administration tasks, making it easier for users to maintain their Linux systems
efficiently.
Advantages of Linux
• The main advantage of Linux is it is an open-source operating system. This means the source code is easily available for everyone and you are
allowed to contribute, modify and distribute the code to anyone without any permissions.
• In terms of security, Linux is more secure than any other operating system. It does not mean that Linux is 100 percent secure, it has some
malware for it but is less vulnerable than any other operating system. So, it does not require any anti-virus software.
• The software updates in Linux are easy and frequent.
• Various Linux distributions are available so that you can use them according to your requirements or according to your taste.
• Linux is freely available to use on the internet.
• It has large community support.
• It provides high stability. It rarely slows down or freezes and there is no need to reboot it after a short time.
• It maintains the privacy of the user.
• The performance of the Linux system is much higher than other operating systems. It allows a large number of people to work at the same time
and it handles them efficiently.
• It is network friendly.
• The flexibility of Linux is high. There is no need to install a complete Linux suite; you are allowed to install only the required components.
• Linux is compatible with a large number of file formats.
• It is fast and easy to install from the web. It can also install it on any hardware even on your old computer system.
• It performs all tasks properly even if it has limited space on the hard disk.
Network_lecture_for_students_whom_intersted.pptx
Disadvantages of Linux
• It is not very user-friendly. So, it may be confusing for beginners.
• It has small peripheral hardware drivers as compared to windows.
Linux Directory Structure:
Linux Directory Structure:
• /bin: Essential binary executables.
• /etc: Configuration files.
• /home: User home directories.
• /var: Variable data, such as logs and spool files.
• /usr: User binaries and program libraries.
• /sbin: System binaries.
• /tmp: Temporary files.
• /proc: Virtual filesystem providing process information.
• /dev: Device files.
• /boot: Boot loader files and the kernel.
https://www.linuxfoundation.org/blog/blog/c
lassic-sysadmin-the-linux-filesystem-explained
6/22/2024 13
6/22/2024 14
Introduction to the Command Line
• cd: To navigate between different folders.
• rmdir: Removes empty directories from the directory lists.
• cp: Moves files from one directory to another.
• mv: Rename and Replace the files
• rm: Delete files
• uname: Command to get basic information about the OS
• locate: Find a file in the database.
• touch: Create empty files
• ln: Create shortcuts to other files
• cat: Display file contents on terminal
• clear: Clear terminal
• ps: Display the processes in terminal
• grep: Search for a specific string in an output
• echo: Display active processes on the terminal
• wget: download files from the internet.
• whoami: Create or update passwords for existing users
• sort: sort the file content
• whereis: View the exact location of any command typed after this command
• df: Check the details of the file system
• wc: Check the lines, word count, and characters in a file using different options
Linux Networking:
Linux provides robust networking capabilities, supporting various protocols and services. Key
networking concepts include:
• IP Addressing: Configuring IP addresses using tools like ifconfig or ip.
• Routing: Managing the routing table using the route or ip route commands.
• Firewall: Linux has built-in firewall capabilities with tools like iptables or firewalld.
• DNS Resolution: Configuring DNS settings in /etc/resolv.conf.
• Networking Tools: Tools like ping, traceroute, and netstat for troubleshooting and monitoring.
Understanding these aspects of Linux is essential for effective system administration, development, and
DevOps practices.
Linux Networking Commands:
• Ifconfig: Display or configure network interfaces.
• Route: Display or manipulate the IP routing table.
• Netstat: Display network connections, routing tables, interface statistics, masquerade connections, and
multicast memberships.
• Ping: Send ICMP ECHO_REQUEST to network hosts.
• traceroute: Print the route packets take to a network host.
• nslookup: Query DNS servers to obtain domain name or IP address mapping.
• dig: A flexible tool for interrogating DNS name servers.
• ifup/ifdown: Bring a network interface up or down.
• iptables: Administration tool for IPv4 packet filtering and NAT.
Linux Services/Process:
• Process:
• A process is an instance of a running program on a computer system.
• It represents the execution of a program's instructions in memory, along with its associated resources (such as memory, CPU time, and I/O resources).
• Each process has its own address space, which contains the program code, data, and stack.
• Processes are managed by the operating system, which schedules them for execution on the CPU and provides mechanisms for inter-process
communication, synchronization, and resource management.
• Service:
• A service is a type of software component or application that runs continuously in the background, providing specific functionality or performing certain
tasks.
• Services typically operate independently of user interaction and are designed to run without interruption.
• They often provide functionality such as network services (e.g., web servers, FTP servers), system services (e.g., printing, file sharing), or application
services (e.g., database services).
• Services can be implemented as standalone processes, but they can also run within the context of a larger application or as part of the operating system
itself.
• Services may be started automatically when the system boots or initiated manually by a user or another program.
• In summary, while a process represents the execution of a program, a service is a specific type of software component that provides continuous
functionality or performs tasks in the background, often independently of user interaction. Processes can include services, but not all processes are
services.
Processes:
Common Commands for Managing Processes:
ps: Display information about processes.
top: Real-time system monitoring tool that provides a
dynamic view of processes.
kill: Terminate a process by its PID.
pkill: Send signals to processes based on their name
Services:
Common Commands for Managing Services:
systemctl: Control the systemd system and service manager.
## systemctl start/stop/restart/status [service_name]
service: Interact with system services.
## service [service_name] start/stop/restart/status
chkconfig: Configure services to start or stop automatically at different run levels.
## chkconfig --list
## chkconfig [service_name] on/off
journalctl: Query and display messages from the journal, managed by systemd.
## journalctl
## journalctl -u [service_name]
Lab on Services and Process
Install Apache on your Linux OS ; Please determine the process ID & the commands used to manage
the service
Linux Security
1. Regular Updates: Keep the system and software up-to-date with the latest security patches.
2. User Accounts: Disable unnecessary user accounts / Enforce strong password policies.
3. Firewall Configuration: Use a firewall to control incoming/outgoing network traffic
4. File System Security: Set appropriate file permissions and ownership using chmod and chown.
5. Logging and Auditing: Configure system logging to track security events.
6. Limiting Access: Restrict physical/remote access, Disable unnecessary network ports and services
6/22/2024 23
Linux working with files:
6/22/2024 24
Navigating the File System:
● cd (Change Directory): cd /path/to/directory
● pwd (Print Working Directory): pwd
● ls (List Files and Directories): ls
Creating and Deleting Files:
● touch (Create Empty File): touch filename
● vi (Text Editors to Create/Edit Files): vi filename
● cp (Copy Files): cp source_file destination
● mv (Move/Rename Files): mv old_file new_file
● rm (Remove/Delete Files): rm filename / rm -r
directory
Linux working with files:
6/22/2024 25
Viewing File Content:
● cat (Concatenate and Display File Content): cat filename
● more and less (Paging Through File Content): more filename /
less filename
● head and tail (Viewing the Beginning or End of a File): head/tail
filename
Searching for Text in Files:
● grep (Search Text in Files): grep "pattern"
filename
● find (Search for Files and Directories): find
/path/to/search -name "filename"
Linux working with files:
6/22/2024 26
Archiving and Compression:
tar (Create or Extract Tar Archives): tar -cvf
archive.tar files / tar -xvf archive.tar
gzip and gunzip (Compress and Decompress
Files): gzip filename / gunzip filename.gz
Checking File Information:
stat (Display File Status): stat filename
file (Determine File Type): file filename
Symbolic Links:
ln (Create Symbolic Links): ln -s target
link_name
File System Usage:
df (Display File System Disk Space Usage): df -h
du (Display File Space Usage): du -h filename
Research Soft Link vs Hard Link
6/22/2024 27
Questions
6/22/2024 28
Linux file/dir permissions:
6/22/2024 29
Viewing Permissions:
ls (List Files): ls -l
Symbolic Representation of Permissions:
File permissions are represented as a 10-character string:
Linux file/dir permissions:
Changing Ownership:
● chown (Change Owner): chown
new_owner:new_group filename
● chgrp (Change Group): chgrp new_group
filename
Changing Permissions:
● chmod (Change Mode): chmod permissions filename
Examples:
Recursively change permissions for all
files in a directory:
chmod -R permissions directory
chmod g+x filename
chmod o-x filename
Linux file/dir permissions:
Special Permissions:
Setuid (s), Setgid (s), and Sticky Bit (t):
Setuid: Allows a program to run with the privileges of the file owner.
Setgid: Causes files created in a directory to inherit the group of the directory.
Sticky Bit: Prevents users from deleting or renaming each other's files in a directory.
Examples:
Linux install and update packages
General Package Management Tips:
Package Managers:
Debian/Ubuntu: apt or apt-get
Red Hat/CentOS: yum (older systems) or dnf (newer systems)
Always Update Before Installing:
Before installing new packages, it's a good practice to update the package lists to ensure you get the latest
versions.
Upgrading Packages: Regularly upgrade installed packages to get security updates and new features.
Repository Configuration: Configure repositories properly to access the necessary packages.
sudo apt update
sudo apt upgrade
sudo apt install package_name
sudo apt remove package_name
apt search package_name
sudo yum check-update
sudo yum update
sudo yum install package_name
sudo yum remove package_name
Linux Cron jobs
Cron is a time-based job scheduler in Unix-like operating systems, including Linux. It allows users to
schedule tasks (commands or scripts) to run periodically at fixed times, dates, or intervals. Here are
some key aspects of working with cron jobs in Linux:
Crontab Syntax:
minute (0 - 59) hour (0 - 23) day of month (1 - 31) month (1 - 12) day of week (0 - 6) command
Examples:
Run a command every day at 2:30 AM:
Run a script every Monday at 4:45 PM:
Linux Cron jobs
Editing Crontab:
To Edit Your Crontab: crontab -e
Viewing Crontab:
To View Your Crontab: crontab -l
To View Another User's Crontab: crontab -l -u username
Removing Crontab:
To Remove Your Crontab: crontab -r
Commonly Used Operators:
Asterisk (*): Represents all possible values for the respective field.
For example, * * * * * means every minute of every hour, every day.
Comma (,): Specifies a list of values.
For example, 1,15 * * * * means at minute 1 and 15 of every hour.
Hyphen (-): Specifies a range of values.
For example, 0 2-6 * * * means every hour from 2 to 6 AM.
Special Strings:
@reboot: Run once at startup.
@daily, @weekly, @monthly, @yearly:
Run once a day, week, month, or year,
Linux Cron jobs
Important Notes:
● Paths and Environment:
Always use absolute paths for commands and scripts in cron jobs.
Set the environment variables if the cron job requires specific settings.
● User-Specific:
Each user has their own crontab, and cron jobs run with the privileges of the user who owns the
crontab.
● Logging:
Redirect the output of cron jobs to log files to monitor their execution and capture any errors.
● Testing:
Test cron jobs and scripts outside of the cron environment before scheduling them.
● 1. Install Centos or Ubuntu On Virtual Box ( or Vmware)
windows sublinux
playground kuberntes : linux playgrounds -> ubuntu
● 2. Try The following commands:
● a. pwd
● b. cd
● c. ls
● d. man
● e. Display the man pages of passwd command.
● f. Write the command which display the man page of the
● passwd file”/etc/passwd”
● g. Write the command which display a list of all the commands
● that contain the keyword “passwd” in their man/manual
● page.
36
37
● 17. What are the minimum permission needed for:
● Copy a directory (permission for source directory and permissions for target
● parent directory)
● Copy a file (permission for source file and and permission for target parent
● directory)
● Delete a file
● Change to a directory
● List a directory content (ls command)
● View a file content (more/cat command)
● Modify a file content
● 18. Create a file with permission 444. Try to edit in it and to remove it? Note what
● happened.
● 19. What is the difference between the “x” permission for a file and for a
● directory?
38

More Related Content

PPTX
introduction to Linux operating system .pptx
AnuradhaJadiya1
 
PDF
Linux for embedded_systems
Vandana Salve
 
PPTX
Introduction, Features, Basic Commands and Distribution of LINUX
Deeksha Verma
 
PPTX
Linux – an introduction
Wingston
 
PPTX
VISHWA PPT.pptxdgkdagkjgjhhhggcugguggiiu
giresumit9
 
PPT
Difference between Unix & Linux Presentation.ppt
sarwechabro
 
PPTX
OPERATING SYSTEM.pptxmlkjjjjjnnnnnhfdsss
giresumit9
 
introduction to Linux operating system .pptx
AnuradhaJadiya1
 
Linux for embedded_systems
Vandana Salve
 
Introduction, Features, Basic Commands and Distribution of LINUX
Deeksha Verma
 
Linux – an introduction
Wingston
 
VISHWA PPT.pptxdgkdagkjgjhhhggcugguggiiu
giresumit9
 
Difference between Unix & Linux Presentation.ppt
sarwechabro
 
OPERATING SYSTEM.pptxmlkjjjjjnnnnnhfdsss
giresumit9
 

Similar to Network_lecture_for_students_whom_intersted.pptx (20)

PDF
Linux Presentation_SSD.pdf
ssuser37b0e0
 
PDF
How to Audit Linux - Gene Kartavtsev, ISACA MN
Gene Kartavtsev
 
PDF
unixoperatingsystem-130327073532-phpapp01.pdf
IxtiyorTeshaboyev
 
PDF
Linux: Everyting-as-a-service
Rohit Sansiya
 
PPT
linux pppt for introduction of the Linux
harjinderkaur06126
 
PPT
Linux for everyone
Pradeep Shankhwar
 
PPT
operating system ondesktop computer ( laptop)
BandaruGowtham1
 
PPTX
Linux Basic having information about basic of linux
amishh95
 
PPT
Chapter 6 - INTRODUCTION TO NETWORK OPERATING SYSTEM - 0S and NOS.ppt
Mirahsz Arashian
 
PPT
Linux [2005]
Raul Soto
 
PPT
Linux - Introductions to Linux Operating System
Vibrant Technologies & Computers
 
PPTX
Linuxtraining 130710022121-phpapp01
Chander Pandey
 
PPTX
Network and System Administration Power Point
kemal678348
 
PDF
Bn 1027 demo linux adminstration
conline training
 
PPT
Linux basics
Santosh Khadsare
 
PPTX
linux operating system.pptx
Kailash510466
 
PPT
Linux forensics
Santosh Khadsare
 
PPTX
Linux@assignment ppt
Rama .
 
PPT
Linux操作系统01 简介
lclsg123
 
PDF
Redhat Linux server administration industrial training report.
AlokGupta336
 
Linux Presentation_SSD.pdf
ssuser37b0e0
 
How to Audit Linux - Gene Kartavtsev, ISACA MN
Gene Kartavtsev
 
unixoperatingsystem-130327073532-phpapp01.pdf
IxtiyorTeshaboyev
 
Linux: Everyting-as-a-service
Rohit Sansiya
 
linux pppt for introduction of the Linux
harjinderkaur06126
 
Linux for everyone
Pradeep Shankhwar
 
operating system ondesktop computer ( laptop)
BandaruGowtham1
 
Linux Basic having information about basic of linux
amishh95
 
Chapter 6 - INTRODUCTION TO NETWORK OPERATING SYSTEM - 0S and NOS.ppt
Mirahsz Arashian
 
Linux [2005]
Raul Soto
 
Linux - Introductions to Linux Operating System
Vibrant Technologies & Computers
 
Linuxtraining 130710022121-phpapp01
Chander Pandey
 
Network and System Administration Power Point
kemal678348
 
Bn 1027 demo linux adminstration
conline training
 
Linux basics
Santosh Khadsare
 
linux operating system.pptx
Kailash510466
 
Linux forensics
Santosh Khadsare
 
Linux@assignment ppt
Rama .
 
Linux操作系统01 简介
lclsg123
 
Redhat Linux server administration industrial training report.
AlokGupta336
 
Ad

Recently uploaded (20)

PDF
Doc9.....................................
SofiaCollazos
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
PDF
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Doc9.....................................
SofiaCollazos
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Ad

Network_lecture_for_students_whom_intersted.pptx

  • 1. DevOps Essentials and Pre- requisites Presented by Mohamed Ramadan 6/22/2024 1
  • 2. Recap 1- What is DevOps 2- Could you please explain CICD
  • 3. Content 1- Introduction to Linux 2- Useful Linux Commands 3- Introduction to Bash Scripting
  • 4. Introduction to Linux What is Linux ? Linux is a powerful and flexible family of operating systems that are free to use and share. It was created by a person named Linus Torvalds in 1991. What’s cool is that anyone can see how the system works because its source code is open for everyone to explore and modify. This openness encourages people from all over the world to work together and make Linux better and better. Since its beginning, Linux has grown into a stable and safe system used in many different things, like computers, smartphones, and big supercomputers. It’s known for being efficient, meaning it can do a lot of tasks quickly, and it’s also cost- effective, which means it doesn’t cost a lot to use.
  • 5. Linux Distributions and Differences: ● Ubuntu: Known for its ease of use and community support. ● Debian: Emphasizes stability and free software principles. ● Fedora: Often used for cutting-edge features and technologies. ● CentOS/RHEL (Red Hat Enterprise Linux): Known for stability and widely used in enterprise environments. ● Arch Linux: Follows a rolling release model and is highly customizable. ● openSUSE: Known for its YaST configuration tool and flexibility. ● Linux Mint: Focuses on user-friendliness and multimedia support. Note: The differences among distributions primarily lie in package management systems, default desktop environments, release cycles, and system administration tools.
  • 6. Linux Scope for DevOps: ● Scripting and Automation: Bash and other scripting languages are integral to automating repetitive tasks. ● Containerization: Linux is the foundation for container technologies like Docker and Kubernetes. ● Configuration Management: Tools like Ansible, Puppet, and Chef are widely used on Linux systems. ● Version Control: Git, a distributed version control system, is essential in DevOps workflows and is platform-independent. ● Cloud Computing: Many cloud platforms, such as AWS and Azure, run on Linux servers.
  • 7. Architecture of Linux • Kernel: Kernel is the core of the Linux based operating system. It virtualizes the common hardware resources of the computer to provide each process with its virtual resources. This makes the process seem as if it is the sole process running on the machine. The kernel is also responsible for preventing and mitigating conflicts between different processes. • System Library:Linux uses system libraries, also known as shared libraries, to implement various functionalities of the operating system. These libraries contain pre-written code that applications can use to perform specific tasks. By using these libraries, developers can save time and effort, as they don’t need to write the same code repeatedly. System libraries act as an interface between applications and the kernel, providing a standardized and efficient way for applications to interact with the underlying system. • Shell:The shell is the user interface of the Linux Operating System. It allows users to interact with the system by entering commands, which the shell interprets and executes. The shell serves as a bridge between the user and the kernel, forwarding the user’s requests to the kernel for processing. It provides a convenient way for users to perform various tasks, such as running programs, managing files, and configuring the system. • Hardware Layer: The hardware layer encompasses all the physical components of the computer, such as RAM (Random Access Memory), HDD (Hard Disk Drive), CPU (Central Processing Unit), and input/output devices. This layer is responsible for interacting with the Linux Operating System and providing the necessary resources for the system and applications to function properly. The Linux kernel and system libraries enable communication and control over these hardware components, ensuring that they work harmoniously together. • System Utility: System utilities are essential tools and programs provided by the Linux Operating System to manage and configure various aspects of the system. These utilities perform tasks such as installing software, configuring network settings, monitoring system performance, managing users and permissions, and much more. System utilities simplify system administration tasks, making it easier for users to maintain their Linux systems efficiently.
  • 8. Advantages of Linux • The main advantage of Linux is it is an open-source operating system. This means the source code is easily available for everyone and you are allowed to contribute, modify and distribute the code to anyone without any permissions. • In terms of security, Linux is more secure than any other operating system. It does not mean that Linux is 100 percent secure, it has some malware for it but is less vulnerable than any other operating system. So, it does not require any anti-virus software. • The software updates in Linux are easy and frequent. • Various Linux distributions are available so that you can use them according to your requirements or according to your taste. • Linux is freely available to use on the internet. • It has large community support. • It provides high stability. It rarely slows down or freezes and there is no need to reboot it after a short time. • It maintains the privacy of the user. • The performance of the Linux system is much higher than other operating systems. It allows a large number of people to work at the same time and it handles them efficiently. • It is network friendly. • The flexibility of Linux is high. There is no need to install a complete Linux suite; you are allowed to install only the required components. • Linux is compatible with a large number of file formats. • It is fast and easy to install from the web. It can also install it on any hardware even on your old computer system. • It performs all tasks properly even if it has limited space on the hard disk.
  • 10. Disadvantages of Linux • It is not very user-friendly. So, it may be confusing for beginners. • It has small peripheral hardware drivers as compared to windows.
  • 12. Linux Directory Structure: • /bin: Essential binary executables. • /etc: Configuration files. • /home: User home directories. • /var: Variable data, such as logs and spool files. • /usr: User binaries and program libraries. • /sbin: System binaries. • /tmp: Temporary files. • /proc: Virtual filesystem providing process information. • /dev: Device files. • /boot: Boot loader files and the kernel.
  • 15. Introduction to the Command Line • cd: To navigate between different folders. • rmdir: Removes empty directories from the directory lists. • cp: Moves files from one directory to another. • mv: Rename and Replace the files • rm: Delete files • uname: Command to get basic information about the OS • locate: Find a file in the database. • touch: Create empty files • ln: Create shortcuts to other files • cat: Display file contents on terminal • clear: Clear terminal • ps: Display the processes in terminal • grep: Search for a specific string in an output • echo: Display active processes on the terminal • wget: download files from the internet. • whoami: Create or update passwords for existing users • sort: sort the file content • whereis: View the exact location of any command typed after this command • df: Check the details of the file system • wc: Check the lines, word count, and characters in a file using different options
  • 16. Linux Networking: Linux provides robust networking capabilities, supporting various protocols and services. Key networking concepts include: • IP Addressing: Configuring IP addresses using tools like ifconfig or ip. • Routing: Managing the routing table using the route or ip route commands. • Firewall: Linux has built-in firewall capabilities with tools like iptables or firewalld. • DNS Resolution: Configuring DNS settings in /etc/resolv.conf. • Networking Tools: Tools like ping, traceroute, and netstat for troubleshooting and monitoring. Understanding these aspects of Linux is essential for effective system administration, development, and DevOps practices.
  • 17. Linux Networking Commands: • Ifconfig: Display or configure network interfaces. • Route: Display or manipulate the IP routing table. • Netstat: Display network connections, routing tables, interface statistics, masquerade connections, and multicast memberships. • Ping: Send ICMP ECHO_REQUEST to network hosts. • traceroute: Print the route packets take to a network host. • nslookup: Query DNS servers to obtain domain name or IP address mapping. • dig: A flexible tool for interrogating DNS name servers. • ifup/ifdown: Bring a network interface up or down. • iptables: Administration tool for IPv4 packet filtering and NAT.
  • 18. Linux Services/Process: • Process: • A process is an instance of a running program on a computer system. • It represents the execution of a program's instructions in memory, along with its associated resources (such as memory, CPU time, and I/O resources). • Each process has its own address space, which contains the program code, data, and stack. • Processes are managed by the operating system, which schedules them for execution on the CPU and provides mechanisms for inter-process communication, synchronization, and resource management. • Service: • A service is a type of software component or application that runs continuously in the background, providing specific functionality or performing certain tasks. • Services typically operate independently of user interaction and are designed to run without interruption. • They often provide functionality such as network services (e.g., web servers, FTP servers), system services (e.g., printing, file sharing), or application services (e.g., database services). • Services can be implemented as standalone processes, but they can also run within the context of a larger application or as part of the operating system itself. • Services may be started automatically when the system boots or initiated manually by a user or another program. • In summary, while a process represents the execution of a program, a service is a specific type of software component that provides continuous functionality or performs tasks in the background, often independently of user interaction. Processes can include services, but not all processes are services.
  • 19. Processes: Common Commands for Managing Processes: ps: Display information about processes. top: Real-time system monitoring tool that provides a dynamic view of processes. kill: Terminate a process by its PID. pkill: Send signals to processes based on their name
  • 20. Services: Common Commands for Managing Services: systemctl: Control the systemd system and service manager. ## systemctl start/stop/restart/status [service_name] service: Interact with system services. ## service [service_name] start/stop/restart/status chkconfig: Configure services to start or stop automatically at different run levels. ## chkconfig --list ## chkconfig [service_name] on/off journalctl: Query and display messages from the journal, managed by systemd. ## journalctl ## journalctl -u [service_name]
  • 21. Lab on Services and Process Install Apache on your Linux OS ; Please determine the process ID & the commands used to manage the service
  • 22. Linux Security 1. Regular Updates: Keep the system and software up-to-date with the latest security patches. 2. User Accounts: Disable unnecessary user accounts / Enforce strong password policies. 3. Firewall Configuration: Use a firewall to control incoming/outgoing network traffic 4. File System Security: Set appropriate file permissions and ownership using chmod and chown. 5. Logging and Auditing: Configure system logging to track security events. 6. Limiting Access: Restrict physical/remote access, Disable unnecessary network ports and services
  • 24. Linux working with files: 6/22/2024 24 Navigating the File System: ● cd (Change Directory): cd /path/to/directory ● pwd (Print Working Directory): pwd ● ls (List Files and Directories): ls Creating and Deleting Files: ● touch (Create Empty File): touch filename ● vi (Text Editors to Create/Edit Files): vi filename ● cp (Copy Files): cp source_file destination ● mv (Move/Rename Files): mv old_file new_file ● rm (Remove/Delete Files): rm filename / rm -r directory
  • 25. Linux working with files: 6/22/2024 25 Viewing File Content: ● cat (Concatenate and Display File Content): cat filename ● more and less (Paging Through File Content): more filename / less filename ● head and tail (Viewing the Beginning or End of a File): head/tail filename Searching for Text in Files: ● grep (Search Text in Files): grep "pattern" filename ● find (Search for Files and Directories): find /path/to/search -name "filename"
  • 26. Linux working with files: 6/22/2024 26 Archiving and Compression: tar (Create or Extract Tar Archives): tar -cvf archive.tar files / tar -xvf archive.tar gzip and gunzip (Compress and Decompress Files): gzip filename / gunzip filename.gz Checking File Information: stat (Display File Status): stat filename file (Determine File Type): file filename Symbolic Links: ln (Create Symbolic Links): ln -s target link_name File System Usage: df (Display File System Disk Space Usage): df -h du (Display File Space Usage): du -h filename
  • 27. Research Soft Link vs Hard Link 6/22/2024 27
  • 29. Linux file/dir permissions: 6/22/2024 29 Viewing Permissions: ls (List Files): ls -l Symbolic Representation of Permissions: File permissions are represented as a 10-character string:
  • 30. Linux file/dir permissions: Changing Ownership: ● chown (Change Owner): chown new_owner:new_group filename ● chgrp (Change Group): chgrp new_group filename Changing Permissions: ● chmod (Change Mode): chmod permissions filename Examples: Recursively change permissions for all files in a directory: chmod -R permissions directory chmod g+x filename chmod o-x filename
  • 31. Linux file/dir permissions: Special Permissions: Setuid (s), Setgid (s), and Sticky Bit (t): Setuid: Allows a program to run with the privileges of the file owner. Setgid: Causes files created in a directory to inherit the group of the directory. Sticky Bit: Prevents users from deleting or renaming each other's files in a directory. Examples:
  • 32. Linux install and update packages General Package Management Tips: Package Managers: Debian/Ubuntu: apt or apt-get Red Hat/CentOS: yum (older systems) or dnf (newer systems) Always Update Before Installing: Before installing new packages, it's a good practice to update the package lists to ensure you get the latest versions. Upgrading Packages: Regularly upgrade installed packages to get security updates and new features. Repository Configuration: Configure repositories properly to access the necessary packages. sudo apt update sudo apt upgrade sudo apt install package_name sudo apt remove package_name apt search package_name sudo yum check-update sudo yum update sudo yum install package_name sudo yum remove package_name
  • 33. Linux Cron jobs Cron is a time-based job scheduler in Unix-like operating systems, including Linux. It allows users to schedule tasks (commands or scripts) to run periodically at fixed times, dates, or intervals. Here are some key aspects of working with cron jobs in Linux: Crontab Syntax: minute (0 - 59) hour (0 - 23) day of month (1 - 31) month (1 - 12) day of week (0 - 6) command Examples: Run a command every day at 2:30 AM: Run a script every Monday at 4:45 PM:
  • 34. Linux Cron jobs Editing Crontab: To Edit Your Crontab: crontab -e Viewing Crontab: To View Your Crontab: crontab -l To View Another User's Crontab: crontab -l -u username Removing Crontab: To Remove Your Crontab: crontab -r Commonly Used Operators: Asterisk (*): Represents all possible values for the respective field. For example, * * * * * means every minute of every hour, every day. Comma (,): Specifies a list of values. For example, 1,15 * * * * means at minute 1 and 15 of every hour. Hyphen (-): Specifies a range of values. For example, 0 2-6 * * * means every hour from 2 to 6 AM. Special Strings: @reboot: Run once at startup. @daily, @weekly, @monthly, @yearly: Run once a day, week, month, or year,
  • 35. Linux Cron jobs Important Notes: ● Paths and Environment: Always use absolute paths for commands and scripts in cron jobs. Set the environment variables if the cron job requires specific settings. ● User-Specific: Each user has their own crontab, and cron jobs run with the privileges of the user who owns the crontab. ● Logging: Redirect the output of cron jobs to log files to monitor their execution and capture any errors. ● Testing: Test cron jobs and scripts outside of the cron environment before scheduling them.
  • 36. ● 1. Install Centos or Ubuntu On Virtual Box ( or Vmware) windows sublinux playground kuberntes : linux playgrounds -> ubuntu ● 2. Try The following commands: ● a. pwd ● b. cd ● c. ls ● d. man ● e. Display the man pages of passwd command. ● f. Write the command which display the man page of the ● passwd file”/etc/passwd” ● g. Write the command which display a list of all the commands ● that contain the keyword “passwd” in their man/manual ● page. 36
  • 37. 37
  • 38. ● 17. What are the minimum permission needed for: ● Copy a directory (permission for source directory and permissions for target ● parent directory) ● Copy a file (permission for source file and and permission for target parent ● directory) ● Delete a file ● Change to a directory ● List a directory content (ls command) ● View a file content (more/cat command) ● Modify a file content ● 18. Create a file with permission 444. Try to edit in it and to remove it? Note what ● happened. ● 19. What is the difference between the “x” permission for a file and for a ● directory? 38