0% found this document useful (0 votes)
29 views57 pages

LINUX

The document provides an overview of Linux operating systems, describing what an operating system is, the different types of operating systems including desktop, server, mobile and embedded operating systems, and then focuses on what Linux is and some of the major Linux distributions like Red Hat, CentOS and Ubuntu. It also discusses how Linux compares to other operating systems like Unix and Windows, and highlights some of the major users and industries that utilize Linux systems.

Uploaded by

Laïla Belokda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views57 pages

LINUX

The document provides an overview of Linux operating systems, describing what an operating system is, the different types of operating systems including desktop, server, mobile and embedded operating systems, and then focuses on what Linux is and some of the major Linux distributions like Red Hat, CentOS and Ubuntu. It also discusses how Linux compares to other operating systems like Unix and Windows, and highlights some of the major users and industries that utilize Linux systems.

Uploaded by

Laïla Belokda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

Understanding Linux

Concepts
What is Operating System?
As per Wikipedia
An operating system is system software that manages computer hardware and software
resources, and provides common services for computer programs

In simple words
An operating system (OS) is software that acts as a middleman or a bridge between
computer hardware and the computer user. It provides a user interface and controls the
computer hardware so that software can function

Types of Operating Systems:


1. Desktop Operating Systems, e.g., Microsoft Windows, macOS, and Linux such as Ubuntu
2. Server Operating Systems, e.g., Windows Server, Linux distributions like CentOS, Red Hat Enterprise Linux
3. Mobile Operating Systems, e.g., Android, iOS, Windows Mobile
4. Embedded Operating Systems used in devices like routers, smart TVs, automobiles, home appliances etc.
5. Real-Time Operating Systems (RTOS) used in critical systems like medical equipment, car ECUs,
aerospace,
defense, network firewalls, home security system etc.
What is Linux?
Linux is an Operating System which sits in
the middle of your hardware and users
Unix vs. Linux
• Unix was first developed for multi-user and multi-tasking in mid-1970 in Bell Labs by
ATT, GE and Massachusetts institute of Technology
• Then born Linux in 1991 by Linus Torvalds
• Linux is mostly free
• Linux is open source
• Unix is mostly used by Sun as Solaris, HP-UX, AIX etc.
• Linux is used by many developers community or companies (Redhat, CentOS, Debian)
etc.
• Unix comparatively supports very fewer File systems
• Linux can be installed on a wide variety of computer hardware, ranging from mobile
phones, tablets, video game consoles, to mainframes and supercomputers.
114 Linux Commands
Linux vs. Windows
Linux Distributions

Redhat
Linux Users
• US Government and Agencies (National, State, Federal and International)
• NASA
• Health Care
• The Bullet Trains in Japan runs at the speed of 150-215 m/h
• Traffic Control
• Financial Institutes e.g. NYSE
• Entertainment industries (Cinemas, Production houses etc.)
• World e-commerce leaders, including Amazon, eBay, PayPal, and Walmart run
their platform on Linux
• Other fortune 500 companies e.g. Google, IBM, McDonalds, Facebook etc.
Download, Install and
Configure Linux
Lab
Option 1 Design
Option 2

Virtual Machine Virtual Machine

VMWare player Oracle


VirtualBox
Virtualization software Cloud Services
What is Oracle
VirtualBox?
• VirtualBox is a free and open-source hypervisor for x86
computers currently being developed by Oracle Corporation

• It installs on your existing Intel or AMD-based computers,


whether they are running Windows, Mac, Linux or Solaris
operating systems. It extends the capabilities of your existing
computer so that it can run multiple operating systems on one
hardware at the same time

Linux Windows MAC

Oracle Virtual Box


Operating System (Windows or MAC)
Hardware
Oracle virtual Box
Download and
Installation
vMWare Workstation Player

Download, Installation and


Configuration
CentOS vs. CentOS
Stream
• Brief history of CentOS

Community Enterprise Operating


2004
System

Greg Kurtzer

Red Hat OS

2014
CentOS vs. CentOS
Stream
Before Feb 2021

Fedora RHEL CentOS

After Feb
2021

Fedora CentOS Stream RHEL


CentOS vs. CentOS
Stream

Question???

Is it worth learning
CentOS

*** ABSOLUTELY ***


Create
Virtual
Machine
Virtual Machine

VMWare player Oracle


VirtualBox
Virtualization software
Download and Install
Linux (CentOS 7)
• You can use Ubuntu/Kali or any Linux
OS (CentOS = Recommended) 7
• 80% of the Corporate world uses RHEL Virtual Machine

• Regarding CentOS
• CentOS 7
version
• CentOS 8
VMWare player Oracle
Stream VirtualBox
• CentOS 9 Virtualization software

Stream
Download and Install
Linux (CentOS 8)
Skip… 8

Go back Virtual Machine

• Create a VM VMWare player Oracle


• Download CentOS 8 Stream VirtualBox
Virtualization software
ISO
• Install CentOS 8 Stream
Download and Install Linux (CentOS
9 Stream)
Go back… 9
Virtual Machine
• Create a VM
• Download CentOS 9 Stream
ISO
• Install CentOS 9 Stream VMWare player
VirtualBox
Oracle

Virtualization software
Install Linux on
Option 2 Cloud
Skip…
Virtual Machine

Cloud Services
Different Ways to
Install OS
NEXT
RedhatLESSON
Linux Installation

OPTIONAL
Redhat Linux
Installation
Linux Ubuntu Installation

OPTIONAL
Oracle virtual Machine
Management
Keyboard Keys Used in
Linux

Right Ctrl key


System Access and
File System
Important Things to Remember in Linux
• Linux has super-user account called root
• root is the most powerful account that can create, modify, delete
accounts and make changes to system configuration files
• Linux is case-sensitive system
• ABC is NOT same as abc
• Avoid using spaces when creating files and directories
• Linux kernel is not an operating system. It is a small software within
Linux operating system that takes commands from users and pass
them to system hardware or peripherals
• Linux is mostly CLI not GUI
• Linux is very flexible as compared to other operating systems.
Access to Linux System
There are 2 types of access
1. Console
2. Remote

The console is a direct access to an operating system when


it is connected through VGA, HDMI, DVI etc.
Access to Linux System
The 2 nd type of access is remote where you connect to your operating
system remotely over the network

Putty
Client
RDP Sharing

Linux to Linux SSH


192.168.1.5
Access to Linux System
Important:
Windows 10 or newer
version
SSH built-in client

ssh 192.168.1.5
Download and Install Putty
If you are using Windows 10 or newer version
then you do NOT have to download or install
Putty
Download and Install Putty
Putty is a software which allows you to connect from a Windows
system to Linux system remotely

192.168.1.5
Access to Linux from MAC

• Open a terminal on your MAC


• Run the following command
• # ssh –l ayoub 192.168.1.5
Access Linux via Putty or SSH

192.168.1.5
Linux

Linux

ssh 192.168.1.5

ssh –l ayoub 192.168.1.5


Access to Linux via Putty

• The newer version of CentOS might not have the ifconfig command, therefore, use
“ip addr ” command instead
• To use ifconfig in 7.5 or later version then run = “ yum install net-tools ”
Access to Linux via SSH

Linux
Command Prompts and Getting Prompts Back

• What are command prompts?


• A command prompt, also referred to simply as a prompt, is a short text
at the start of the command line followed by prompt symbol on a
command line interface

username hostname Prompt symbol

• To get your prompt back


• Ctrl + c
Introduction to Filesystem
• What is a Filesystem?
• It is a system used by an operating system to manage files. The
system controls how data is saved or retrieved

Closet

Shirts Jackets

Accessorie Shoes
s
Pants
Skirts
Introduction to Filesystem
• What is a Filesystem?
• It is a system used by an operating system to manage files. The
system controls how data is saved or retrieved

Closet

Shirts Jackets

Accessorie Shoes
s
Pants
Skirts
Introduction to Filesystem
• Operating system stores files and directories in an organized and
structured way
• System configuration file = Folder A
• User files = Folder B
• Log files = Folder C
• Commands or scripts = Folder D and so on

• There are many different types of filesystems. In general,


improvements have been made to filesystems with new releases of
operating systems and each new filesystem has been given a different
name
• e.g. ext3, ext4, xfs, NTFS, FAT etc.
File System Structure
File System Structure and its Description
/boot Contains file that is used by the boot loader (grub.cfg) root user
/root home directory. It is not same as /
/dev System devices (e.g. disk, cdrom, speakers, flashdrive, keyboard
/etc etc.) Configuration files
/bin /usr/bin Everyday user commands System/filesystem commands
/sbin /usr/sbin Optional add-on applications (Not part of OS apps)
/opt Running processes (Only exist in Memory)
/proc C programming library files needed by commands and apps
/lib usr/lib strace -e open pwd Directory for temporary files Directory for
/tmp user
/ System logs
home System daemons that start very early (e.g. systemd and udev) to
/var store temporary runtime files like PID files
/run To mount external filesystem. (e.g. NFS) For cdrom mounts.
/mnt
/
media
Navigating File System
• When navigating a UNIX filesystem, there are a few important commands:
"cd”
"pwd”
"ls“

• "cd" stands for change directory. It is the primary command for moving you around the
filesystem.
• “pwd” stands for print working directory. It tells you where you current location is.
• “ls” stands for list. It lists all the directories/files within a current working directory
• Using of TAB key to auto-complete
Linux File or Directory Properties
Each file or directory in Linux has detail information or
properties

Type # of Links Owner Group Size Month Day Time Name

drwxr-xr-x. 21 root root 4096 Feb 27 13:33 var

lrwxrwxrwx. 1 root root 7 Feb 27 13:15 bin

-rw-r—r-- 1 root root 0 Mar 2 11:15 testfile

The second column is the number of hard links to the file.


For a directory, the number of hard links is the number of
immediate subdirectories it has plus its parent directory and
itself
Linux File Types
What is Root?
• There are 3 types of root on Linux system
1. Root account: root is an account or a username on Linux machine and it is
the most powerful account which has access to all commands and files

2. Root as /: the very first directory in Linux is also referred as root directory

3. Root home directory: the root user account also has a directory located in
/root which is called root home directory
Changing Password

• You should change your initial password as soon as you


login

Command = passwd userid


Old password: - enter your current password
New password: - enter your new password
Retype new password: - re-enter your new password
File System Paths
• There are two paths to navigate to a filesystem
✔ Absolute Path
✔ Relative Path

• An absolute path always begins with a "/". This indicates that the path starts at the root directory.
An
example of an absolute path is
cd /var/log/httpd

• A relative path does not begin with a "/". It identifies a location relative to your current position.
An example of a relative path is:
cd /var cd log cd httpd
Creating Files and Directories
• Creating Files
✔ touch
✔ cp
✔ vi

• Creating
Directories
✔ mkdir
Copying Directories
• Command to copy a directory
• cp

• To copy a directory on Linux, you have to execute the “cp” command with the “-
R”
option for recursive and specify the source and destination directories to be
copied
• cp -R <source_folder> <destination_folder>
Find Files and Directories

• Two main commands are used to


find files/directories

• find
• locate
Difference Between find and locate

• locate uses a prebuilt database, which should be


regularly updated, while find iterates over a filesystem
to locate files. Thus, locate is much faster than find ,
but can be inaccurate if the database (can be seen as a
cache) is not updated

• To update locate database run updatedb


WildCards

• A wildcard is a character that can be used


as a substitute for any of a class of
characters in a search

• * - represents zero or more characters


• ? - represents a single character
• [] - represents a range of characters
Soft and Hard Links

• inode = Pointer or number of a file on the hard disk


• Soft Link = Link will be removed if file is removed or renamed
• Hard Link = Deleting renaming or moving the original file will not affect
the hard link

• ln
• ln -s

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy