Linux Slides1 to 800 [Compatibility Mode]

Post on 17-Jul-2015

70 views 0 download

Transcript of Linux Slides1 to 800 [Compatibility Mode]

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 1/798

index

Units:

unit-1 About the founder of Linux.

unit-2 Linux VS Windows.

unit-3 Linux Flavors.

- .

unit-5 Kernel.

-

unit-7 Dos Vs Linux.

unit-8 Redhat Linux Installation

unit-9 Hardware Requirements

unit-10 Installation Methods

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 2/798

Unit -1

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 3/798

About the founder of LINUX

•Linus Benedict Torvalds (bornDecember 28, 1969) began theeve opmen o nux, an opera ng

system kernel, and today acts as theproject coordinator.

•Inspired by Minix (a kernel and

operating system developed by AndrewTanenbaum), he felt the need for acapable UNIX operating system that hecould run on his home PC.

•Torvalds did the original developmentof the Linux kernel primarily in his owntime and on his equipment.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 4/798

Evolution of Linux

•Torvalds originally used Minix on hiscomputer, a simplified kernel written

by Andrew Tanenbaum for teachingoperating system design.

•The Linux system quickly surpassed

Minix in functionality.

•The first version of the Linux kernelwas released to the Internet in

September 1991. with the secondversion following shortly thereafter inOctober

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 5/798

TUX - the penguin

•Penguin is the official mascot oft e nux operat ng system.

• ,looks content and satisfied.

•The concept of the Linux mascotbeing a penguin came from Linus

,kernel.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 6/798

GNU’s (Not Unix)

• The GNU project was started in 1983 for developing a complete

- ,

tools and user application programs, entirely of free software.

• By the release of the first version of the Linux kernel, the GNU

project had produced all the necessary components of thissystem except the kernel.

• Torvalds and other early Linux-kernel developers adapted theirkernel to work with the GNU components and user space

ro rams to create a full functional o eratin s stem.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 7/798

FEATURES OF LINUX

• Supports wide variety of hardware.

• Supports many networking protocols and configurations

• .

• Linux has a reputation for fewer bugs (programming

mistakes) than Windows.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 8/798

Linux Vs Windows

Open Source Development Modeland so the programmer can

It is not an open source and hencecannot be redesigned by the

redesign the OS. programmer.

Linux is robust and very muchsecure from virus.

Windows gets affected by virusvery easily.

The Linux servers has surpassedwindows server operating system in

security.

Security is the main issue whichhas made windows to think to

survive.

It costs less to design andimplement a Linux Network.

It costs more to implementWindows Network administration,when compared to Linux.

There are 250000+ developersbehind Linux for open sourcedeployment.

Compared to Linux, windows isdeveloped by few thousands ofpeople.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 9/798

Linux Flavors

• Red Hat Linux (Red Hat)

• Open Linux (Caldera)

 

• Mandrake Linux (Mandrake)

• ur o nux ac c - ec

• Linux PPC (MAC Power PC version)

• Info magic

• Slack ware Linux Project

• Knoppix (Live CD) etc.,

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 10/798

Introduction to Red Hat Linux

• Red Hat has split its Linux development into two lines :

• Red Hat Enterprise Linux and

• The Fedora Project.

• Red Hat EL features commercial enterprise products

for servers and workstations, with controlled releases

issued every two years.

• e e ora pro ect s an open source n t at ve w ose

Fedora Core release will be issued every six months.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 11/798

Kernel

• The kernel is the essential center of a computer

o eratin s stem the core that rovides basic services

for all other parts of the operating system.

• A kernel can be contrasted (compared) with a shell,shell is the outermost part of an operating system thatinteracts with user commands.

• Kernel and shell are terms used more frequently in Unix

opera ng sys ems an n ma n rame or crosoWindows systems.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 12/798

Shells

• Bash shell (Bourne again Shell)

 – Developed for the GNU Project

 – The actual standard Linux shell – Default shell for Red Hat Linux

• Borne shell (sh) – Original Unix shell written by Billoy at er e ey

• s e cs – Added many features such as command, history

Continue…

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 13/798

Shells

• Korn Shell (Ksh) – Written by David Korn

• Implemented many csh features such as

• e n ance s e cs –a commun y e or

• More features like command-line editing and more

sophisticated completion

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 14/798

Shells

 

prompt for bashshell

Type bash and

hit enter

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 15/798

Shells

command prompt

for c-shell (csh)

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 16/798

Shells

command prompt

or en ance

shell (tcsh)

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 17/798

Shells

command

bourne shell

(sh)

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 18/798

Shells

command promptfor korne shell

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 19/798

DOS Vs Linux

Commandomman c on

-

TREE ls –R List directory

recursivel

CD cd Change directory

 

RMDIR rmdir Remove a directory

CHDIR pwd Display directory

location

rm emove a e

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 20/798

DOS Vs Linuxomman

Commandct on

RMDIR /S (NT)rm -r

Remove all directories and files below

95...) 

COPY cp Copy a file

XCOPY cp -r Copy all file of directory recursively

RENAME orMOVE

 

TYPE cat Dump contents of a file to users screen

MORE more Pipe output a single page at a time

HELP orCOMMAND  /?

man Online manuals

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 21/798

DOS Vs Linux

Command 

CommandAction

CLS clear Clear screen

EXIT exit Exit a shell

FIND find Look for a word in files given in command line

FC diff Compare two files and show differences. Also seemgdiff and tkdiff.

SET set and env Show environment variables

 

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 22/798

DOS Vs Linux

Command 

SETvariable 

export variable nameSet environment variables

PATH echo $PATH Display search path for

executables

DATE or date Show date. (also set date -on y

SORT sort Sort dataalphabetically/numerically

 filename.txt  vim

.which looks most like DOSedit is probably Pico.

 \ / Director ath delimiter

.\ ./ Current directory

..\ ../ Parent directory

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 23/798

DOS Vs Linux

BACKUP files A:\ tar -cvf /dev/fd0 Save backup files to floppy

tar -xvf /dev/fd0 Read files from floppy.files See Using DOS floppies

ATTRIB +h or -h mv file .file  Change file to a hidden file - renamee w pre x .

PRINT lpr Print a file

MEM freetop

Show free memory on system

Show s stem info Commands ev

borrowed from AIX)

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 24/798

DOS Vs Linuxomman omman ct on

SCANDISKfsck Check and re air hard drive file s stem

FDISK fdisk Tool to partition a hard drive.

FORMATmke2fs

See: fdformat for

Format drive file system.

For floppy drive use see YoLinux Tutorial

VER uname -a Operating system version

pkzip tar, gzip andbzip2

 files/directories. Use tar to create Linuxalso has compress, gzip

HOSTNAME hostname Print host name of computer

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 25/798

DOS Vs Linux

DOS Command  Command

Action

p ng en pac e s o a ne wor os

TRACERT tracerouteShow routes and router hops to

.

IPCONFIG (NT) ifconfig Display/configure network interface...

NBTSTAT (Netbios info: -n, -c) nslookup host- 

NBTSTAT -a host-name NBTSTAT -A IP-address  name 

.

rou e -n r n rou ng a e.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 26/798

Network CommandsDOS Command  

CommandAction

 

TRACERT tracerouteShow routes and router hops toiven network destination.

IPCONFIG (NT)

WINIPCFG (Win 95...) ifconfig Display/configure network interface

NBTSTAT (Netbios info: -n, -c)

- - 

nslookup host- Print DNS info for host.

 

NBTSTAT -A IP-address 

ROUTE PRINT route -n Print routing table.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 27/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 28/798

Hardware Requirement

32-bit Intel based processor, atleast an Intel or compatible 80386,80486, or Pentium-class

.

400 MHz Pentium is recommendedfor a ra hical interface and 200MHz for text.

Normall 64MB RAM for Text, and192 MB for graphical. (Linux canrun on as little as 12 MB RAM).

At least 2GB free hard disk spacefor a standard installation, includingapplications; 3 to 6 GB or more is

(all applications).

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 29/798

Installation Methods

Red Hat Installation CD-ROM.

NFS Image.

Kick Start

FTP

HTTP

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 30/798

Red Hat Installation through CD

• To boot from a CD-Rom or DVD-Rom ou ma first

have to change the boot sequence setting in your

computer’s BIOS so that the computer will try to boot

first from the CD-Rom.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 31/798

NFS Image

• NFS (Network File Sharing): It is a common method

to s are es.

• An image of an operating system is taken already

system.

• The image system is first mounted and operating

system path is given to get into the installation.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 32/798

Kick Start Installation

• Till now we have seen attended installation, where the user

ave o n erac w e sys em.

• The kick start installation is known as unattended

installation where the user appearance is not necessary.

• The system will automatically install the operating systeminto the machine including the device installation, hard disk

partition, assigning of ip address etc.,

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 33/798

Red Hat Installation

Press Enter, toinstall in

.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 34/798

Red Hat Installation

Type linux text,to install in Text

mode.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 35/798

Red Hat Installation

Type linux askminstall either th

FTP HTTP Haand NFS.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 36/798

Red Hat Installation

T e linux text 

askmethod to installeither through FTP,

,NFS.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 37/798

Installation Setup Screen

The Installation

Type Linux Text and

press enter for Text

mode Installation

Just press enterfor graphical

mode Installation.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 38/798

Hardware Detection

Hardware

detectionprocess

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 39/798

Select theInstallation

.

R dh t I t ll ti

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 40/798

Redhat Installations

Select the t eof keyboard

layout.

R dh t I t ll ti

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 41/798

Redhat Installations

Select theappropriate

type ofinstallation.

R dh t I t ll ti

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 42/798

Redhat Installations

Select theappropriateNFS type

installation.

Redhat Installations

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 43/798

Redhat Installations

Select this

option to assignan dynamic ipaddress.

Redhat Installations

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 44/798

Redhat Installations

Enter theappropriate ip

a ress

Redhat Installations

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 45/798

Redhat Installations

Enter the

information ofserver ip address

.

Redhat Installations

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 46/798

Redhat Installations

The Anaconda-Red Hat

Installer beginse ns a a on.

Redhat Installations

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 47/798

Redhat Installations

Hardware

detectionprocess

Redhat Installations

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 48/798

Redhat Installations

Redhat Installations

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 49/798

Redhat Installations

The Red Hat LinuxWelcomes

ou.

Select the Partitioning T pe

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 50/798

Select the Partitioning Type

Select this fors mp er au oma c

partitioning.

Click here for manualpartitioning. Raid and LVM

also can be configured

used only while installation)

Redhat Installations

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 51/798

Redhat Installations

Click here tocreate new

partition in thefree space

Creating Partition for /boot directory

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 52/798

Creating Partition for /boot directory

Select the file systemmount pointshere.( /boot )

ype ere. ex , exfor normal partitionand swap for swap

artition

Enter the sizeof the

part t onshere.

Creating Partition for / directory

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 53/798

Creating Partition for / directory

Select the file systemmount points

here.( / )

ype ere. ex , exfor normal partition and

swap for swapartition

Enter the sizeof the

part t ons ere.

Creating Partition for swap directory

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 54/798

Creating Partition for swap directory

 mount pointshere.(swap)

Enter the sizeof the

part t ons ere.

Redhat Installations

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 55/798

Redhat Installations

The final viewall the

mounting.

To Set Boot Loader

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 56/798

To Set Boot Loader

Click here to

change thedefault boot

loaderanare the Red Hat

Linux boot loaders.

GRUB is the Default

The default boot

Loader of Red HatLinux 8.0

 

can be changed oradded here

Redhat Installations

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 57/798

eth0 means firstEthernet card itsaddress getting

from DHCP.

 also gettingfrom DHCP

server..

Firewall ConfigurationFirewall Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 58/798

Firewall ConfigurationFirewall Configuration

No firewall optionallows all networkserv ces o your

machine

No firewall option

services to yourmachine

Redhat Installations

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 59/798

Enable firewall

o tion allows

Activate yourSELINUX options

specific networkservices to your

machine

Redhat Installations

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 60/798Redhat Installations

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 61/798

Choose thedefault languagefor the system.

Redhat Installations

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 62/798

Time zone is.

Redhat Installations

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 63/798

Enter thepassword for theroot (Super User)

Redhat Installations

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 64/798

Its readingpackage

information's.

Redhat Installations

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 65/798

Select customizeoptions to customize

the package selections

s s use to se ectthe default package.

Package Selection

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 66/798

The Packages to bens a e are se ec ehere. Even the office

(Like MS-Office

in windowsPackages are

available inbuiltin Red Hat

Package Selection

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 67/798

Checking andinstalling the

.

Beginning of Installation

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 68/798

g g

Click next to begin

the actual installationwhich begins writingthe operating system

in the hard drives.

Installing Packages

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 69/798

Creating the filesystem in the

installationpartition.

Installing Packages

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 70/798

The installationimage is copied to

the hard drive.

Installing Packages

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 71/798

Initializing theinstallation

Installing Packages

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 72/798

Preparing for theinstallation

Installing Packages

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 73/798

 packages under

progress

 tzdata packages

Installing Packages

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 74/798

 packages under

progress

Installing Packages

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 75/798

 packages under

progress

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 76/798

 packages under

progress

Installing Packages

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 77/798

 packages under

progress

Installing Packages

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 78/798

 packages under

progress

Installing Packages

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 79/798

Performin thepost install

configuration.

Reboot the System

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 80/798

The Red Hat Installation iscompleted successfully.

 media and boot disks.And reboot the system.

Rebooting

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 81/798

GRUB boot loader

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 82/798

Hi hli ht the o eratinsystem and press enterto boot.

Loading Kernel

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 83/798

Initializing hardware devices

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 84/798

Initializing services

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 85/798

Welcome to Red Hat Setup

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 86/798

The Red Hat

Welcometo

setup agentwill proceed

someMore basic

 Setup agent

 configurations

Before the systemis ready

o use.

License agreement

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 87/798

Setting date and time

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 88/798

Graphics configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 89/798

Select the screenresolution suiting your

-the number of distinct

colours requiredsupporting the video

monitor and displaycard

card Installed

Red Hat Login

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 90/798

To register the system

to Red Hat enter theLogin name and

password.

Red Hat Login

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 91/798

If you don’t have redhatlogin select this optionto create a new login.

Red Hat Login

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 92/798

Enter this optionto know the

details

Red Hat Login

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 93/798

Click here tore ister with theThe u date a entRed Hat networkregisters the

machine withRed Hat network

Click here toski re istration

 Software packages

Get updatedautomatically

System user creation.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 94/798

Create nonadministrative user toaccess the system.

Sound Card Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 95/798

Tests sounds for the 3channels in sound card

Configuredautomatically

can be heard byselecting play test sound

To Install additional softwares

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 96/798

Click here to install

an additional

software.

Finishing Setup

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 97/798

The Red Hat

Finishes the setup

Login Screen

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 98/798

Login Screen

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 99/798

Red Hat supportsmany languages,

be selected before

login.

Login Screen

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 100/798

The kind of deskto can be selected here.

Login Screen

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 101/798

The system canbe rebooted using

the option.

Login Screen

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 102/798

The system canbe restarted usin

the option.

Login Screen

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 103/798

Enter the userName

Login Screen

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 104/798

Enter the userPassword.

Loading the user settings.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 105/798

Red Hat Startup Screen

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 106/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 107/798

Now the Red HatLinux

is ready for use.

Kernel initialization

• As systems boots, kernel get initialized and thefollowing functions are occurred.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 108/798

g s a

• ev ce etect on: erne w comp e t e ev ce

drivers and locate it to the corresponding devices.

• Mounts root file system: After the device detection

only.

• Load initial process: The very first process (init) is

then loaded.

Initial process

• Init :

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 109/798

• It is the superior of all processes.

• As soon as init process is loaded the control is

assed from kernel to this rocess.

• /etc/inittab:

should setup the system in every run level, as well.

Run levels

init 0 : Shutdown the system or halt

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 110/798

init 0 : Shutdown the system or halt

init 1 : Single-user mode.

n : u -user mo e w ou ne wor ng suppor .

init 3 : Multi-user mode with networking support.

init 4 : Unused.

n t : rap ca user nter ace.

init 6 : Reboot the system.

Run level configuration file

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 111/798

Get in to the

inittab file, the

file.

Run level configuration file

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 112/798

The default

be changedhere.

CONSOLES

• Text-mode login at virtual console

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 113/798

• Multiple non-GUI logins are possible

• Default consoles are in text mode

• Available through CTRL-ALT-F[1-6]

• Graphical console comes through CTRL-ALT-F7

X Window System

• It is the foundation for the graphical user Interface of

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 114/798

• It is the foundation for the graphical user Interface of

Red Hat Linux.

• X applications communicate with a display via. The X

protocol.

• X is OS Independent.

• It is available on many platforms.

X Protocol

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 115/798

• It hides the individual details of the OS and the underlying

hardware.

• X protocol is a asynchronous network protocol for the

communication between X client and X Server.

• It defines how the graphical primitives are communicated

between X client and server.

Multiple Desktop Environments

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 116/798

Environments.

• GNOME (GNU Network Object Modules Environment).

• KDE (K desktop Environment).

GNOME

• It is the default desktop environment for Red Hat

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 117/798

.

• It is Power full and easy-to-use desktop environment

consisting primarily of a panel and a set of GUI tools.

• GNOME is free and hence its source code can be

www.gnome.org.

GNOME Interface

• The GNOME Interface consists of a Panel and a Desktop.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 118/798

• Panel appears as a long bar across the bottom of screen.

, .

• The Remainder Screen is the Deskto . Here ou can lace 

directories, files or programs.

GNOME Desktop

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 119/798

GNOME Menus

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 120/798

GNOME Menus

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 121/798

KDE

• KDE provides an alternative desktop environment with full

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 122/798

.

• Along with GNOME features, It also includes

• Konsole : Highly configurable graphical terminal.

• onqueror : e manager an we rowser.

• Kmail : A graphical email client.

• Kdevelop : Integrated development.

KDE Desktop

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 123/798

KDE Desktop

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 124/798

KDE Desktop

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 125/798

KDE Desktop

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 126/798

Starting X Window

The X window start automatically, If so then a

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 127/798

Graphical login screen is prompted by the Display

.

Alternatively use startx to get in to X window from

non-w n ow ng conso e.

Start X

 

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 128/798

window from runlevel-3

Start X

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 129/798

Desktop Selection

Select failsafein case of an

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 130/798

previously used

desktop

graphical

failure

To get the

defaultdesktop.

To get in toGNOME To get in to

. KDE desktop.

KDE MODE

If you click yes theKDE desktop is set

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 131/798

for future sessions(or) login

you c c o, on ythe current session

is set to KDE.

Switchdesk

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 132/798

To change the desktop

environment.

Switchdesk

To switch from kde to

gnome desktop

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 133/798

gnome desktop

Switchdesk

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 134/798

Thus we switched

into GNOME

deskto

Linux File System Directories

 / Begins the file system structure – called the root.

Directory Function

/b H ld h k l i fil d i d b

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 135/798

 /boot Hold the kernel image files and associated bootinformation and files.

’ .

 /sbin Holds administration-level commands and any

commands used by the root user. /dev Holds file interface for devices such as the terminal

and the rinter.

 /etc Holds system configuration files and any other

system files.

e c op o s sys em con gura on es or app ca on n /opt

Linux File System Directories

 /etc/X11 Holds system configuration files for the X Window

Directory Function

System and its applications.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 136/798

System and its applications.

 /bin Holds the essential user commands and utility

ro rams.

 /lib Holds essential shared libraries and kernelmodules.

 /lib/modules Holds the kernel modules.

 /mnt Used to hold directories for mounting file systemslike CD-ROMs or floppy disks that are mounted

only temporarily. /o t Holds added software a lications for exam le,

KDE on some distributions).

Linux File System Directories

 /proc Process directory, a memory-resident directory

Directory Function

containing files used to provide information about

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 137/798

co ta g es used to p o de o at o aboutthe system.

 /tm Holds tem orar files.

 /usr Holds those files and commands used by the

subdirectories.

 /var Holds files that vary, such as mailbox and FTP.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 138/798

Linux Commands

• Commands have the following syntax:

• Command [options] [arguments]

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 139/798

[ p ] [ g ]

• Options modify the command’s behavior

• Arguments are filenames or other information

needed by the command

DOS Vs Linux

Command

omman c on

-

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 140/798

TREE ls –R List directory recursivly

CD cd Change directory

 

RMDIR rmdir Remove a directory

CHDIR pwd Display directory

location

rm emove a e

DOS Vs Linuxomman

Command

ct on

RMDIR /S (NT)rm -r

Remove all directories and files below

95...) 

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 141/798

)

COPY cp Copy a file

XCOPY cp -r Copy all file of directory recursively

RENAME or

MOVE

 

TYPE cat Dump contents of a file to users screen

MORE more Pipe output a single page at a time

HELP orCOMMAND  /?

man Online manuals

DOS Vs Linux

Command 

CommandAction

CLS clear Clear screen

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 142/798

EXIT exit Exit a shell

FIND grep Look for a word in files given in command line

FC diff Compare two files and show differences. Also seemgdiff and tkdiff.

SET set and env Show environment variables

 

DOS Vs Linux

Command 

SETvariable 

export variable nameSet environment variables

PATH echo $PATH Display search path for

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 143/798

executables

DATE or date Show date. (also set date -on y

SORT sort Sort dataalphabetically/numerically

 

filename.txt  vim

.

which looks most like DOSedit is probably Pico.

 \ / Director ath delimiter

.\ ./ Current directory

..\ ../ Parent directory

DOS Vs Linux

BACKUP files A:\ tar -cvf /dev/fd0 Save backup files to floppy

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 144/798

tar -xvf /dev/fd0 Read files from floppy.files See Using DOS floppies

ATTRIB +h or -h mv file .file Change file to a hidden file - rename

e w pre x .

PRINT lpr Print a file

MEMfreetop

Show free memory on system

Show s stem info Commands ev

borrowed from AIX)

DOS Vs Linuxomman omman c on

SCANDISKfsck Check and repair hard drive file system

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 145/798

FDISK fdisk Tool to partition a hard drive.

FORMATmke2fsSee: fdformat for

Format drive file system.For floppy drive use see YoLinux Tutorial

VER uname -a Operating system version

Compress and uncompress

pkziptar, gzip andbzip2

.compilation of a directory before

compressing. Linux also has compress,gzip

HOSTNAME hostname Print host name of computer

DOS Vs Linux

DOS Command 

CommandAction

p ng en pac e s o a ne wor os

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 146/798

TRACERT traceroute Show routes and router hops to.

IPCONFIG (NT)ifconfig Display/configure network interface

...

NBTSTAT (Netbios info: -n, -c) nslookup host- NBTSTAT -a host-name NBTSTAT -A IP-address 

name .

rou e -n r n rou ng a e.

Network CommandsDOS Command

 Command

Action

 

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 147/798

TRACERT tracerouteShow routes and router hops toiven network destination.

IPCONFIG (NT)WINIPCFG (Win 95...)

ifconfig Display/configure network interface

NBTSTAT (Netbios info: -n, -c)

- - 

nslookup host- Print DNS info for host.

 NBTSTAT -A IP-address 

ROUTE PRINT route -n Print routing table.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 148/798

Login screen

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 149/798

Enter the

PWD

• PWD

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 150/798

• Present working Directory

• Display the absolute path of the current directory.

PWD

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 151/798

The absolute

path of the root

directory isdisplayed.

ls

ls :

List the Files and Directories within the current directory.

Syntax:

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 152/798

ls o tions 

Options:

- s e w perm ss on.

-a List hidden file.

-i List files and inode number.

-R List directories , sub directories and their

contents.

ls

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 153/798

 directories in the

present directory.

ls -l

l option lists the

l li ti f

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 154/798

long listing of 

directory.

l l command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 155/798

The name of the group

which has the

Owner name, theuser who created

No of links to thedirectory

t e nes t e

permissions

assigned to theFile or directory

names.

 Size of the files

or directories

permissions over the files

or directories

the directory.owners, groups and

other users

ls -a

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 156/798

[a] option lists all files

hidden files

ls -al

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 157/798

al option lists all files and

directories including

format.

ls -R

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 158/798

[R] option lists workingdirectory as well as

contents in the director .

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 159/798

mkdir

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 160/798

This will create a

.

cd

cd- Change directories

Syntax :

cd <directory name>

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 161/798

y

..

- To a directory one level up (parent directory)

cd -- To your previous working directory

cd / 

- To the / slash director

cd

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 162/798

This commandwill take you to

the directory .

cd ~

Previous slide

we have seen cd

along with any

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 163/798

director name.This command

cd ~ <enter>

home directory

cd ..

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 164/798

cd .. Take ou to theparent directory of the

current directory.

cd ..

Now we can see that

we are in advpro

directory, the parent

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 165/798

director of the test

cd / 

cd / will take

you to / 

directory)

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 166/798

through pwd command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 167/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 168/798

cat

cat

 – it is the command to create and view files

Syntax:

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 169/798

 

>

cat [filename] To view a file

ca >> ename o appen ex o a

file

cat

As mentioned in

slide. cat is used

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 170/798

to create a file

The file is saved

roug c r -

after typing thetext

cat

Enter

cat < ename>

to view the

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 171/798

content of file.

cat

To append the

text in a file,

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 172/798

and file name.

cat

Th

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 173/798

The screenshows the

appended file

cat

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 174/798

The -s o tion

trims multipleadjacent blank 

blank line

cat

The –b option

numbers the

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 175/798

of the output

cat

The –A option shows

all characters including

con ro an non

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 176/798

con ro an non

printing characters

Here the $ represents

the end of the line

touch

touch command is used to update the time stamps of a file.

touch is also used to create empty file.

S ntax : touch filename

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 177/798

 – S ntax : touch filename 

touch can create multiple empty file too.

 – Syntax : touch [filename1] [filename2]

touch

 

empty file is

created

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 178/798

touch

Multiple files

using touch

command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 179/798

Copy Command

cp : cp command is known for copying files and

  – Syntax : cp [options] source destination

– p ons :

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 180/798

  – p ons :

-r recursively copy an entire directory tree

-p preserve permissions, ownership, and timestamps

 – Example :

c File1 File2

Copy Command

There is a filename a nthe directory

test

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 181/798

test .

Copy Command

Here we notice that

directory. Let uscopy the file ‘a’ into

s rec ory

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 182/798

s rec ory.

Copy Command

Cp copies the file ‘a’rom t e rectory

test to the directory

test1.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 183/798

test1.

Copy Command

Thus the file ‘a’

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 184/798

test1 directory.

Copy Command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 185/798

 and old are

listed with their.

Copy Command

-r option copy

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 186/798

r option copythe entire

‘old’

Copy Command

us t e

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 187/798

contents ofold director

is copied tonew.

Copy Command

Command l lshows the

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 188/798

shows thepermission of

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 189/798

Copy Command

Now, we

one to the

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 190/798

one to thedirectory old

Copy Command

See thecomparisonof the file oneshown above

and old

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 191/798

and olddirectory

Copy Command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 192/798

Now using command cpa ong w –p op on epermission is preserved.

Move Command

mv : This command is used to move and renaming filesan rec or es

Syntax:

mv <source> <destination>

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 193/798

mv <source> <destination>

Example

mv file1 file2 (now the file1 is changed to file2)

Move Command

A file is

the name of

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 194/798

the name ofone in therec ory o

Move Command

Here we see

that usin mv command the

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 195/798

file is moved

directory.

Move Command

Now check into the

old directory where

moved. Hence thedirectory is empty

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 196/798

Move Command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 197/798

The file one is shownabove in the new

Move Command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 198/798

 

created testin the old

rectory

Move Command

This exampleshows how to

fil

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 199/798

rename a file

Move Command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 200/798

Using the l lcommand, theabove screen

shows the renamed file

rm and rmdir command

rm : This command is used to remove files

Syntax:rm < ename>

Example :

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 201/798

rmdir : This command is used to remove directories.

Syntax:rmdir <directory name>

Example :

rmdir linux

rm command

This screenshows the

contents of the

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 202/798

contents of the

The above rmcommand is

the file k

rm command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 203/798

 k is removed from

the directory

rmdir command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 204/798

 

named donic which isremoved through the

comman rm r

rmdir command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 205/798

The abovescreen showsthat directory

donic is

rmdir command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 206/798

 

screen we seethat directory

tomy is unableto remove

rm command

Usin rm withoption – r, thedirectory along

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 207/798

directory along

be removed

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 208/798

rm command

The abovescreen shows

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 209/798

screen shows

directory jerry

rm -ri command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 210/798

The rm with –ricommand is

the contents

interactively.

rm -ri command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 211/798

We can see that the filefor which we have given‘ ’ ‘ ’ 

preserved

File command

The file command is used to check the file content.

Syntax :

file <filename>

Example:

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 212/798

Example:

file f1 (f1 is a file. File will show the format) 

a block special file)

File format

The file along with file

name (ss) shows the

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 213/798

File format

This showsthe format

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 214/798

cat asexecutablee

more

l l command

shows thecontents at

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 215/798

.

more

 contentquickly, which

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 216/798

q yma es e

viewer to seeonly last page

more

More is usedto lists the

contents one

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 217/798

time

more

 promptedafter listing

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 218/798

gone y one

more

Here it is

processlisting more

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 219/798

contents,

shown asabove

more

Here it is

processlisting more

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 220/798

contents,

shown asabove

more

 more

command

s over anwe are inthe end of

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 221/798

the end ofthe page

vi & vim editor

Vi is known as the visual editor.It is a standard editor under Linux and Unix system.

Vim is the im roved version of vi editor

Vi have three modes of operation

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 222/798

•Command mode

•Insert mode

•Esc mode

vi Modes

Command mode:

O erations such as cut co aste delete

undo, redo etc., are done in this mode.

Insert mode:

Type in new text

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 223/798

yp

Ex-mode :

Extended commands for saving, exiting, search-

and-replace can executed here

Working with vi editor

 file createdor opened

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 224/798

editor.

Command Mode

Press ‘i’ toget into

mode

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 225/798

Insert Mode

 insert mode

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 226/798

Insert Mode

After typingthe data’s hit

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 227/798

into commandmode

Ex- Mode

Press:wq to

write and

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 228/798

Ex- Mode

Press !to quitwithout

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 229/798

the data

Yank

Hit escape and

type 3yy to yankthree lines from

the cursor osition

Like this example,you can copy any

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 230/798

typing numbers oflines and yy

Text yanked

 slide, we saw howto yank the text.

er yan ng we

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 231/798

er yan ng we

see the messageas below

Text put

Now the yankedtext is pasted fromt e cursor pos t on

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 232/798

t e cursor pos t on

by hitting the ‘p‘

delete

To delete text, placethe cursor in the

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 233/798

and give the totalnumber and dd

delete

Now 3 lines are

deleted andmessage get

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 234/798

fewer lines asshown below

cut and put

To cut a line

after curserposition hit 1cc.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 235/798

cut and put

Get into insert modeand lace the cursor

where the data shouldbe pasted. Press esc

d

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 236/798

mode

cut and put

 t th d t

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 237/798

paste the data.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 238/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 239/798

Search

Then if we press ‘n’ it willshows the second match for

that data.If we continuepressing n it will show

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 240/798

pressing n it will show

successive matches.

Find commandFind:

To search files and directories in a specified path.

Syntax:

Condition:

-name <file name> - to search a particular file

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 241/798

-name <file name> - to search a particular file

-user <user name> - lists the files owned byuser.

-perm <mode> - search a file depending

.

Find command

This commandsearches the

passwor e rom

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 242/798

 / directory.

Find command

The abovescreen shows

the execution of

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 243/798

command

Locate command

Locate:

To search or locate files and directories from the

database.

It locate the files faster than the find command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 244/798

Syntax:

locate [pattern]

Locate command

To search filenamed test1

from database.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 245/798

Locate command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 246/798

All the files anddirectories named

test1 is located and

dis la ed.

Man command

man :

Display helpful information about

commands.

Syntax:

man [option] command

Option:

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 247/798

Opt o

 – - 

command name.

Man command

It displays manualpages for ls

comman .

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 248/798

Man commandThe manual page

of ls command issp aye ere.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 249/798

Enter q to exit frommanual a e.

useradd commanduseradd :

To create a new user account and login.

Useradd will create new entries in system files.

S ntax

useradd [options ] [user ]

Options

-c Comment field.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 250/798

-d Home directory

-e Account expiration date.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 251/798

useradd commandEnter thepassword.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 252/798

User home directory

When new useraccount is created ,a

the user is created

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 253/798

in /home dir.

User configuration files

When a new user account is created, its entries

u dates the followin s stem files.

- /etc/group

- etc s a ow

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 254/798

Passwd fileTo view passwordconfiguration file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 255/798

Passwd file

First fieldx representsUser id.Group id.representencryp e

password is directory. 

shell.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 256/798

username.available inshadow file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 257/798

Shadow file

Encr tedpassword for

the user.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 258/798

Groups file

To viewgroup file

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 259/798

Groups file

Group id forthe user

abdulkalam.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 260/798

User loginAbdulkalamlogging in .

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 261/798

User loginUser

home dir

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 262/798

userdel command

User account can

userdel command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 263/798

Creating groupsNew group is created by hand-editing the file /etc/group

or by using groupadd command.

groupadd groupname

groupdel command is used to remove the group.

Syntax

groupdel groupname

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 264/798

Groupmod is used to rename the existing groupname.

Syntax:

 – 

Groupadd commandA group is added inthe name of india by

groupadd.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 265/798

Usermod command

Using usermodcommand the user

added to group

India

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 266/798

India

Groups file

To viewgroup file

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 267/798

Groups file

The id numberassi ned to the rou

india is 501

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 268/798

e as e s ows euser abdulkalam added

in India group

Groupdel command

Groupdel

window group.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 269/798

Group Administration

Create a directorynamed product

sales.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 270/798

Group Administration

ser s are a e nthe sales groupusing usermod

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 271/798

gcommand.

Group Administration

 group file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 272/798

Group Administration

This shows that thethree users are

group.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 273/798

Group Administration

Change the group namesales to product directoryusing chgrp command.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 274/798

Group Administration

e screen s owsthat the changesbeen made in the

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 275/798

group field.

Group Administration

 product directory.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 276/798

Group Administration

e perm ss onfor the product

directory is

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 277/798

changed.

Group Administration

The user tom is not amember of the group.So the permission is

restricted.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 278/798

Group Administration

suresh logs in terminal. Ashe is the member of the

group, he have the privilege.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 279/798

Group Administration

rajesh logs in terminal. Ashe is the member of the

group, he have the privilege.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 280/798

Group Administration

tom logs in terminal. he isnot the member of the

group so does not have the.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 281/798

Group Administration

The above screenshows the permission

been restricted to the.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 282/798

Changing owner

The chowncommand

After giving thechown command

c ange t e e ordirectory owner.

 changed from

root to suresh.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 283/798

Changing owner

The owner andgroup name can be

c ange us ngchown command.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 284/798

chage commandThe chage command let you specify an expiration limit

for a user's account and password .

 – Syntax:

chage [option] username

Option

- .

-m set the min. days to change the password.

-M set the max. days to change the password.-E specific expiration date for user account

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 285/798

E specific expiration date for user account.

-I set inactive period (in days)

- ,expiration.

User administration

Chage –l : liststhe account andThis field sets thepassword for the

Inactive period isused to give

information of

user tom.

maximum valid

days given.

grace time tochange the

assword.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 286/798

User administration

The –Mcommand with

The passwordexpires field is

100 sets as the

maximum days.

updated by +100days from usercreation date.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 287/798

User administration

Allowableaccount inactivity

which password

will expire.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 288/798

User administration

The -W optionshows the

message before

expiration.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 289/798

User administration

The -m option forminimum number

of da s a usercan exists with

password.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 290/798

User administration

-for specific

expiration datefor an account.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 291/798

Set userIDIt allows an executable file to run under the user or group

security context with the permission of its owner.

SUID can be set as follows:

• chmod u+s [filename]

(or)

• chmod 4xxx [filename]

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 292/798

• chmod 4xxx [filename]

Set userID

The above screenThe passwd is the

password along with

the set user id

comman w c up a esthe password in the

shadow file, instead of not .having the execute

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 293/798

permission.

Set userID

Tom changes theassword usin

passwd command.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 294/798

Set userID

The set userid

removed from the

 /usr/bin/passwd.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 295/798

Set userID

Now we can viewthat tom user

cannot change

the password.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 296/798

Set GroupID

The user sureshlo s et into the

The user suresh

product directory

and create a file.

w o crea e a e,the group name is

assigned as suresh.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 297/798

Set GroupID

The groupid isset to the

Note: the group sales

product

directory.

 product directory.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 298/798

Set GroupID

After setting the groupid, user suresh createsa file win98. Using thecommand ls –l showsthat the file is createdunder the group sales.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 299/798

Sticky bit

The user rajesh logsThe files remove is

file bios created byposs e ecausethe sticky bit is not

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 300/798

ysuresh.

the sticky bit is notset to the product

directory.

Sticky bit

Using +t option thestick is set to theproduct directory.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 301/798

Sticky bit

After assigning the sticky

delete the file created by

other user but he is.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 302/798

Switch user

su command is used to switch to another account from

the command line.

This command is most often used b s stem

administrator to temporarily become the root user

- .

Syntax

su - [user] -c command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 303/798

Switch user

Here the root user

account.(user joe)

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 304/798

Switch user

It executes root privileged command

from the ordinary user.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 305/798

Multi user loginLike unix operating system where multi user login can

,supports multi user login.

Each user can login in each terminal and can do multi

process ng w c avo s ogg ng o rom e sys em.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 306/798

Multi user

tom, is the userwho log in thefirst terminal

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 307/798

Multi user

Joe, is theuser who log

terminal

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 308/798

Multi user

harry, is theuser who log

terminal

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 309/798

Multi user

wilson, is theuser who log

terminal

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 310/798

Multi user

bill, is the userwho log in thefifth terminal

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 311/798

Multi userthano, is the

user who lo sin the sixthterminal

W is the command tolist the users logged

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 312/798

list the users logged

n

vance ses o an

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 313/798

File RepositioningPress G, Cursor go to last line of a file.

, .

Press Ctrl+f, Cursor forward one full screen.

Press Ctrl+b, Cursor go back one full screen.

Press Ctrl+d, Cursor go down half a screen.

ress r +u, ursor go up a a screen.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 314/798

Screen Repositioning

Press H, Cursor go to first line on screen.

Press M, Cursor go to middle line on screen.

Press L, Cursor go to last line on screen.

Press Z+Enter, Make current line is first line on screen.

-

screen.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 315/798

screen.

Advanced Reading and SavingIt is also possible to read a other file content in your

current files.

e o ow ng comman e p you : – Go to exmode in a vi editor

 – 

 – Example :r /root/file1

While working in a editor we can copy the file content to

another file – Syntax : starting line, endingline w <file name>

 – Example : 1,20w file2

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 316/798

 – ,

FilteringA powerful feature of vi is the ability to include into your document

the output of Linux commands.

For example if you want to display any command output in your file

see following syntax .

!!command

The syntax will be working in exmod in editor.

For example to display date ,type following command in exmod.

!!date

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 317/798

Filtering

Open the file

in vi mode.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 318/798

Filtering

This will replace

the current line

with output of the

date command.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 319/798

Filtering

The out ut of the

date command is

written here.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 320/798

Sed CommandSed command just like find and replace .

To display a file , the Sed command change the

particular word in standard input only , but notchan e ori inal content of file.

xamp e o e comman .

sed ‘s/ram/raju/g’ /root/file1

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 321/798

Sed Command

The output of the

named.local is

.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 322/798

Sed Command

Here sed command displays the

output by replacing the localhostas www.example.com, but it wont

write output in the file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 323/798

ex mode : search and replacevi can perform search and replace operations much

e se comman .

Syntax:

ex mode:1,$s/searchname/replacename/g

, - .

s - String of character

g - replace multiple matches in a

line

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 324/798

ex mode : search and replace

Open the filein vi mode.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 325/798

ex mode : search and replace

It searches and replaces

the localhost aswww.exam le.com.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 326/798

ex mode : search and replace

Thus the localhostwas replaced as

www.example.com..

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 327/798

Advanced Reading and SavingIt is also possible to read a other file content in your

current files.

The following command help you :

 – Go to ex mode in a vi editor

 – Syntax : r <filename>

 – Example :r /root/file1

While working in a editor we can copy the file content toanother file

 – ,

 – Example : 1,20w file2

 – Exam le : 21,40w >> file2

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 328/798

Advanced Reading and Saving

ere you can v ew

output of test file.

 

mode.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 329/798

Advanced Reading and Saving

To display the

output of another

the current file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 330/798

Advanced Reading and Saving

The output of testfile is displayed..

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 331/798

Advanced Reading and Saving

The contents of theexisting file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 332/798

Advanced Reading and Saving

To write the contents of the existing file in another

file named test1.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 333/798

Advanced Reading and Saving

The contents are

appended to thetest1 file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 334/798

Advanced Reading and Saving

You can see the

in the test1 file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 335/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 336/798

Set number

File contents.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 337/798

Set number

To assign numbers

editor.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 338/798

Set all

To view all the

possibilities of 

configurationsavailable in vi

editor.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 339/798

Set all

All the available

option are

displayed here.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 340/798

Redirecting Input and OutputOuput of a command is redirected to a file

 – Command > filename

Example ls -i >> /root/file1

Output of file redirected to a command

 – Command < filename

-

• Error message of a command redirected to a file- Command 2> file1

- Command 2>> file1

- – – 

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 341/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 342/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 343/798

Redirecting Input and Output

Here the output of ls command is

appended to the

ex1 file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 344/798

Redirecting InputA command which accepts the input from a file is

known as Redirecting Input.

Syntax - command < file1

Example : tr ‘A-Z’ ‘a-z’ < file1

A file is created in the name file1 and text is

en ere n cap a e ers, w c s re rec e

through < symbol and the command translates the

a a o sma e ers.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 345/798

Redirecting Input and Output

tr translates the upper case

letters to lower case.Hereout ut of file v is

redirected as input to the tr

command.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 346/798

Redirecting Input and Output

> re rects t eerror messages to

the ex file.

Here we can see

redirected error

messa es in the exfile.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 347/798

Piping

Pipes is used to execute more than one command at a time. See

following command.

Syntax : command1 | command2

Example: ls -l | more

It is also used to execute command result

Example: cat file1 | grep station

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 348/798

Piping

ere e ca an

grep command

are executed inpipeline

.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 349/798

Redirecting Both Standard Output And Error

If find command is executed, its output can be stored in file2. if

error occurs during execution, the error message is stored in

file1.

or examp e:

find / -name passwd 2> file1 >file2

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 350/798

Redirecting Both Standard Output And Error

If there is anyerror messa es

If there is no error

while execution

the error message

e ou pu w e

redirected to the

ex2 file.to the file ex1.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 351/798

tee Commandtee is useful to save the output at various stages from

a ong sequence o p pes.

 – 

The above exam le shows the t es of ls commandsand options are used to store output to the files g1,g2 and g3.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 352/798

tee Command

It saves the output

of ls in file a1 and

output of ls –l in

file b2.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 353/798

grep command

grep

- means general regular expression processor.

- ana yze e con en o a e a ne a a me,returning a line that matches a pattern.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 354/798

grep command

Grep prints thepattern matched

with ganesh in the

file /etc/passwd.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 355/798

awk command

An awk program searches for lines in a file

an per orms some ac on on ose nes.

Example:awk ‘/bash/ rint ’ /etc/ asswd

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 356/798

awk command

awk display first

e o e /etc/fstab file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 357/798

File CompressionsSeveral compression utilities are available for use on

Linux and Unix s stem.

But most software for Linux system use threecompression utilities.

-

2 - GNU gzip

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 358/798

Compression commandcompress:

It compresses a file and give the extension as .z forthat file.

Syntax:

compress < ename>

uncompress:

It uncompress the compressed file.

Syntax:

uncompress <filename>

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 359/798

Compression command

Thise actua

size of file is

107 b tes.  

the file a.

The compressed file

Thus the file size

s n cate y t e .z

extension.This

is compressed to

39 bytes.

uncompress

the file a.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 360/798

Compression with gzipgzip utility compresses file .

unzi decom resses them.

To compress a file, enter the command gzip and the

.

version of it,with the extension .gz.

.

Syntax:

gz p ename compress on

gunzip filename.gz (decompression)

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 361/798

Compression with gzip

 

size of file is107 bytes.gzip command

file a.

The compressed file

s n cate y t e

.gz extension.Thus the file size

is compressed to

38 bytes.

 uncompress

the file a.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 362/798

Compression with bzip2

It compresses files using the burrows-wheeler block-sorting text compression algorithm and huffman

coding.You compresses files using the bzip2 command and

.

The bzip2 command create a file with the extension.bz2

Syntax:

bzip2 filename (compression)

bunzip2 filename.bz2 (decompression)

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 363/798

Compression with bzip2

 

size of file is107 bytes.bzip2 command

file a.

The compressed file

This

s n cate y t e

.bz2 extension.Thus the file size

uncompress

the file a .is compressed to

51 bytes.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 364/798

Creating ArchivesTar:

ar comman s use o crea e arc ves on ev ce or es.Originally, tar was used to create archives on tape devices,

.

When creating a file for a tar archive, the filename is usually. .

While tar is seldom used to back up entire file system.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 365/798

Syntax for tar command

Syntax for tar command:

- -.

Options:

c - create new arc ve.

v - produce verbose message.

f - archivename,a name of new file.

x - archive will be extracted in the current directory.

t - displays a list of file in the archive

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 366/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 367/798

tar command

 

display all thefile in backup .

tvf options

displays along

with the user

and group

names.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 368/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 369/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 370/798

Printer-configuration

Command to

configure the

r nter

Click Newo tion to

add printer

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 371/798

Printer-configuration

Now the system is

loadin rinter

information.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 372/798

Printer-configuration

Click  Forward

queue

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 373/798

Printer-configuration

Chooselocally-connected

option for localprinter

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 374/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 375/798

Printer-configuration

 

manufacture name in

he list.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 376/798

Printer-configuration

Choose the serialnumber of the printer

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 377/798

Printer-configuration

 for

What you have

selected

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 378/798

Printer-configuration

Now the printerconfiguration

applying the

changes to the

system

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 379/798

Printer-configuration

Choose yes you will be

getting an test page form

the printer

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 380/798

Printer-configuration

lpq is a command to view

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 381/798

Printer-configuration

lpr is a command given

to print particular file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 382/798

Printer-configuration

lpq is a command to view

t e queue n pr nter

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 383/798

Printer-configuration

lpq is a command to

v ew t e num er o

queue in printer

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 384/798

Introduction to process

Linux treats each task performed on your system as a, .

You can examine this rocess and even sto them.

Red Hat provides several tools for examining processesas well as your system performances.

e process s easy mon or ng s prov e y severaGUI tools,like Red Hat Procman System Monitor.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 385/798

ps Command• .

• To display a information about process specific to

the active terminal.

• Syntax: ps [option]• Options available:

-a : o sp ay a process, not nc u ng

process not controlled by a terminal

-

a terminal, such as daemon process.

-l : To long list including more information such

as process owner's user id.

-u : To display user name of the process

owner.

-e : To view the all process id

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 386/798

pstree command

s ows e

process ancestry

for all process

running on the

system.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 387/798

ps –a command

sp ay a

processes

excluding

processes not

controlled by..

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 388/798

ps –l command

It list the

rocesses alon

with the owners

id.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 389/798

ps –x command

sp ay a

processes

including

processes

controlled by.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 390/798

ps –u command

It list theprocesses along

with the user

name.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 391/798

kill process

• Kill command is used to send a particular process to

get clear.

• S ntax : Kill -9 < rocess id>

• ps - aux is the command to view all process name

and id

• -command, option and the process id to kill.)

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 392/798

kill process

It kills the tty2

term na as

processes .

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 393/798

Altering process schedule

• renice is the command to set the priority of a process.

• The priority value can range from -20 (highest priority)to 19 (Lowest priority)

• Syntax : renice - +(minus symbol or plus symbol)

<priority number> -p <process id>

• xamp e : ren ce - -p

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 394/798

Foreground and Background process

• Fg command is used to run the background process in

the fore round Front End 

•  jobs command helps you to view the background

processes.

• Step 1: jobs <enter> to view the process

running and job numbers

•  • bg command is used to resume the suspended

command in the back grounded.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 395/798

Foreground and Background process

‘&’ makes the

in background.Jobs displays the

processes runningin the background.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 396/798

Foreground and Background process

Fg bring back the

back grounded

rocesses to the

foreground.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 397/798

Foreground and Background process

Here the

command is

suspendedwhile

pressing ctrl+z.Bg resumes the

stopped jobs tothe

background.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 398/798

Bash Shell Scripting

Scripting basics

 – A shell script is a text file containing set of commands.

 – Scripts are useful for automating process that you perform

repeatedly at the command line.

 –  ,

through scripts.

 – For example : Every morning when you login you can

perform following operations.

• Checking system date and time

• Checking email

• How many users have logged in the server.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 399/798

Creation of shell scripts

Shell script are written in vi editor

,

 – For example:

• #!/bin/bash used for bash shell script

• #!/bin/sh used for borne shell script

• #!/bin/csh used for C shell script

• # usr n per use or er s e scr pt

• #!/usr/bin/python used for Python shell script

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 400/798

Basic bash shell script

How to print a data in a console

  – ec o e at <enter>

How to execute a command in echo statement

  – echo “hostname `hostname` “ <enter>

How to execute a variable in echo statement

 – =

 – echo “A value: $A” <enter>

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 401/798

Execute bash shell script file

Two methods available to execute a script file are

 – First method is

• Syntax :

» bash filename

– Second method is

• Syntax :

»Give the execute permission the script file

through chmod command

»Run the file by ./<file name>

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 402/798

Bash Shell Scripting

Get in toe v e or

to createscript file

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 403/798

Bash Shell Scripting

It denotes weare usingas s e

scripts

This script executes

hostname and date

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 404/798

Executing script - First Method

Bashexamp e

(file name)to execute

Output is

shown in theterminal

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 405/798

Executing script - Second Method

No executepermissionfor a file in

default

Permission is,

asexecutable

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 406/798

Second Method

./ example(file name)to execute

the file

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 407/798

Arithmetic Calculation

Exam lescript file forcalculation

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 408/798

Arithmetic Calculation

Using read

read the valuefor A and B

Using exprwe can add

va ues

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 409/798

The values areentered for input

The output is

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 410/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 411/798

Partitions

The Linux supports four primary partitions and many

logical partitions in the extended partition.

The Linux kernel supports maximum number of 63

artitions on each IDE disk.

And maximum of 15 partitions on each SCSI device.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 412/798

Partition Types

Linux-specific partitions would normally be one of the

.

0 X 5 - Extended

0 X 82- Linux swap

0 X fd - Linux RAID

0 X 8e- Linux LVM

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 413/798

Partitioning

In Linux, partitions can be created by either of the

o ow ng ree u es

 – fdisk

 – sfdisk

 – disk druid (only available during installation)

 – 

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 414/798

fdisk

fdisk

- Fixed Disk

- Menu driven programs to create and

Before starting fdisk, identify the hard disk type that is

whether primary master or slave and secondary

master or slave by using command fdisk -l.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 415/798

Partitioning with fdisk

l option list the

available

partitions

 

space with totalheads, sectors and

cy n ersAvailable partitions, hdb

represents that the hard

Star indicates

the boot

Starting and ending

cylinder for each

Size of the partitions

in blocksdisk is connected as

primary slavepartition.

 

cylinder = 8.3MB

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 416/798

Partitioning with fdisk

To create partition in

the device hdb

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 417/798

Partitioning with fdisk

Type h or help to

shows list of 

available commands

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 418/798

Partitioning with fdisk

Type p to display the

available partitions

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 419/798

Partitioning with fdisk

Enter the starting

ype n to create a

new partition

 

enter to take the

default cylinder

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 420/798

Partitioning with fdisk

Enter the ending

cylinder or type thesize in MB.

Type w to save and.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 421/798

Partitioning with fdisk

nstea o restart ng to

update the partition tableust enter the command

partprobe.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 422/798

Partitioning with fdisk

Thus a new partition

created

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 423/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 424/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 425/798

minux & reiserFS

Minux : This file system is small , simple and mostlyused for floppy disk .It support filenames up to 30characters.

e ser : s a vance ourna ng esys em sunder development for Linux.

Its main difference between ext3 and reiserFS .Its usedisk resource efficiently and is particularly effective

w e sys em con a n ng many sma es an argedirectories

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 426/798

Creating file system

Once you create a partition, you have to create a file

.

To do this, use the mkfs command. To build the Linux

file system and pass the name of the harddisk

artition as a arameter.

Syntax:

mkfs -t <filesystem type> <partitioname>

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 427/798

Creation of file system

Current partitions

are displayed here

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 428/798

Creation of file system

Hdb6,7and 8 arenewly created

partitions.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 429/798

Creation of file system

It creates ext2file system for

the device hdb6.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 430/798

To view the file system type

Dumpe2fs : this command is used to view which file

system we are us ng.

S ntax :

dumpe2fs <partitions>

Example:

 

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 431/798

To view the file system type

It displays the

file system

information's.

Sparse_super

represents theext2 file system.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 432/798

Mke2fs command

Mke2fs : This command is used to create file system.

mke2fs [options] device

Example: 

mke2fs /dev/hda1 (it will create ext2 filesystem forhda1 partition)

mke2fs – /dev/hda1 it will create ext3 files stem

for hda1 partition)

C i f fil

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 433/798

Creation of file system

It creates ext2

file systems for

device hdb7.

Vi h fil

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 434/798

View the file system type

S arse su er_represents the

ext2 file system.

C i 2 3 fil

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 435/798

Converting ext2 to ext3 file system

It converts the file

system of hdb7 from

ext2 to ext3

Vi th fil t t

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 436/798

View the file system type

has_journal

represents the ext3file system thus the

ext2 is converted to

ext3

M t d

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 437/798

Mount command

n nux, e any

other device the

artitions should be

Mount the partitions

hda6 in data1

director and hda7 inmounted.data2 directory.

T 2f d

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 438/798

Tune2fs command

tune2fs : It is a command used to converting from

ext2 to ext3 file system without un mounting..

 

tune2fs –j <partitions>

Example:

tune2fs -j /dev/hda1

View the file system type

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 439/798

View the file system type.

Ext2 is the current

device hdb6.

Tune2fs command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 440/798

Tune2fs command

Here it converts the

file system for hdb6

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 441/798

Repair Filesystem

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 442/798

Repair Filesystem

e2fsck : This command checks the consistency of the

,

file system checking tools.

fsck : This command checks and repair a Linux file

sys em.

Example : fsck /dev/hda1

The main difference is e2fsck it will work in ext2 andext3 filesystem and fsck will work only in ext3 file

system.

Repair Filesystem

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 443/798

Repair Filesystem

fsck and e2fsck arethe command used

to check and repair

the file s stem.

Disk usage

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 444/798

Disk usage

df and du are used to check the disk usage.

df : It reports the amount of space used and

available on a mount file system as reported.

du : It displays directories entries and the number of

.

df command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 445/798

df command

df commanddisplays the space

in the mounted filesystems

df -h, displays size

in human readable

-

 of 1024

size in the power1000 instead of 

.

du command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 446/798

du command

du command displaysthe estimate file space

usa e available

df -h & H, displays size in

human readable format in

the power of 1024 and

.

Performance tools

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 447/798

Performance tools

free command lists the free ram memory and as well as

.

top command lists the most CPU intensive processes.

Vmstat shows the performance of system components.

free command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 448/798

free command

free commanddisplay

information

about free and

used memoron the system.

vmstat

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 449/798

vmstat

Report virtualmemory statistics

top

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 450/798

top

Displays top CPUprocesses

top

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 451/798

top

It displays the

CPU-intensive

tasks on the system.

Daemon Process

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 452/798

Daemon Process

Some process start at boot time and continue runninguntil the system is shutdown. Such process are

known as daemon processes.

Two types of daemon process:

standalone daemon

Transient daemon

Daemon Process

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 453/798

Daemon Process

Standalone daemon are a program that run all the time

and are started up either directly by init or by a startup

script under /etc/rc.d.

rans en aemon are on y s ar e up w en ey are

needed, and are controlled by a standalone daemon

called xinetd.

checkconfig command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 454/798

g

The chkconfig command can also be used to activateand deactivate services.

The chkconfig --list command displays a list of systemservices and whether they are started (on) or stopped

- .

At the end of the list is a section for the servicesmanaged by xinetd.

checkconfig command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 455/798

g

chkconfig can also be used to configure a service to

be started (or not) in a specific run level. For

example, to turn httpd off in runlevels 3, 4, and 5,

chkconfig --level 345 httpd off

checkconfig command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 456/798

g

--list options

used to list theservice.

checkconfig command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 457/798

--list option

lists xinetdservices also.

checkconfig command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 458/798

--list option list

httpd serviceThis command

htt d service is

--list options

used to list htt drunlevel 0-6.

stop on runlevel

3-5.

service status .

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 459/798Standard Boot loader

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 460/798

• There are two standard boot loader are used inLinux

• GRUB

• Grand unified boot loader

 

GRUB

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 461/798

• GRUB Grand Unified Boot Loader

and default boot loader for Redhat Linux.

• Using GRUB user can select operating systems to

run from a menu interface displayed when a systemboot up

,

editing mode and a shell like command line interface

ava a e a oo me.

LILO

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 462/798

• means nux oa er

• LILO is a program written to boot sector of a disk that loads

the OS and starts execution.

• It is an older version of boot loader of Red Hat Linux.

• LILO loads the Kernel based on its actual sector location on

the disk , rather than its file name

LILO

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 463/798

• /etc/lilo.conf - Configuration file

• o -v - o ns a or up a e e o

boot loader.

• lilo -t - Test the configuration beforeinstallation.

• lilo -u - To restore the MBR backup.

• - -the a current boot loader.

Lilo installation

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 464/798

Check the

the lilo

package.

Copy the

lilo.conf.anaconda

to lilo.conf lilo

lilo –v

installs lilo

configuration file).

oot oa er.

Lilo installation

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 465/798

Thus the lilo

boot loader

is installed.

This command displays

the current boot loader,thus we can see the lilo

.

Lilo installation

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 466/798

Open the lilo

configuration file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 467/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 468/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 469/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 470/798

GRUB Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 471/798

Open the grub

file.

GRUB Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 472/798

The options rhgb quiet

will start xserver while

bootin .

emove s op ons o

boot through textmode.

Grub Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 473/798

Save the file

.

GRUB Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 474/798

ow re oot t e

system.

GRUB Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 475/798

Now system is booting

in text mode .

GRUB Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 476/798

Now system is booting

in text mode .

GRUB Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 477/798

Now system is booting

in text mode .

GRUB Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 478/798

Now system is booting

in text mode .

GRUB Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 479/798

Now system is booting

in text mode .

GRUB Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 480/798

Now system is booting

in text mode .

GRUB Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 481/798

Now system is booting

in text mode .

GRUB Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 482/798

Open the grub

file.

GRUB Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 483/798

The options rhgb quiet

will start xserver whilebootin .

GRUB Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 484/798

ow re oot t e

system.

GRUB Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 485/798

Now system isbooting in

graphical mode.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 486/798

In EL-4 redhat-config-*

tools are renamed as

system-config-*.

GRUB installation

N th b t

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 487/798

Now the boot

loader is lilo.

To install grub loader use

the command

- .

GRUB installation

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 488/798

Open the

configuratio

n file.

GRUB installation

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 489/798

If default isLabel for firstFlash screen to beThis represents that theBoots the kernelIt loads the initial

se o zero

then it boot

through first

.displayed at boot

time.

 

partition of the hard disk on

hd0.

image.s .

stanza.Loads the

dual OS.

 second

stanza.

GRUB installation

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 490/798

To set password to

loader.

It gives us the encrypted format of the

.be entered in the grub.conf file. This can

be done by the following method.

GRUB installation

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 491/798

 

type the password two times,

this will append the encrypted

password to the grub.conf file.

GRUB installation

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 492/798

Open the

configuration

file.

GRUB installation

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 493/798

Here we cansee the

appended

assword.

GRUB installation

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 494/798

Just cut and

password

here.

Save the file and

system.

GRUB installation

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 495/798

Here you can see the

Type p to enter grub

password if you

want to o to sin le

for the OS to boot.user mode.

GRUB installation

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 496/798

 

password

here.

GRUB installation

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 497/798

Change the command

prompt to get in to

that press ‘e.’

GRUB installation

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 498/798

 to run level 1.

GRUB installation

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 499/798

Press b to

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 500/798

Using rpm command

• rpm command is used to manage and install

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 501/798

software packages.

• This command performs installation, removal and

.

• Each package is actually an rpm packages.

• rpm consists of an archive of software file and

information to install.

• Each archive is resides as a single file with a name.

Using rpm commandrpm command is used either for installing or uninstalling

package.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 502/798

Syntax:

rpm [parameter] package name [options]

parameter:- - .

-U - Updates package.

-e - Remove a package.

-q - sp ays n orma on or an ns a epackage.

-ql - Displays file list for installed package.

-qpi - Displays information from an rpm package file.

(used for uninstalled packages)-qpl - Displays file list from an rpm package file. (used

for uninstalled packages)

Using rpm command

Options:

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 503/798

--force - Forces installation des ite conflicts.

--nodeps - Install or remove without doing any

dependency checks.

--aid - Automatic dependency to install a package.

(While available of package rpmdb-redhat

aid option will work)

Querying the packing

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 504/798

rpm –q a

querying a

particular package

Using rpm command

rpm –q checkswhether the above

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 505/798

whether the above.

r m –e commandwill remove thehttp package.

Using rpm command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 506/798

For installing the

the mount the

operating system

cd-rom of RHELand then only we

can install the

packages.

Using rpm command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 507/798

Go to

Redhat

rectory.

Using rpm command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 508/798

Go to

RPMS

directory.

Using rpm command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 509/798

List the files in

RPMS directory

and we can seethat the packages

end with an

extension .rpm.

Using rpm command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 510/798

rpm –qpi shows

about the packagebefore installation.

Using rpm command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 511/798

 shows the

list of files ina pac age

beforeinstallation.

Using rpm command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 512/798

r m –ivh is

to install a

package.

Using rpm command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 513/798

- ,

a package.

Using rpm command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 514/798

rpm –qi

shows theinformationabout the

acka e afterinstallation.

Using rpm command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 515/798

 –  the list of files in

a package afterns a a on.

To view an IP-addressTwo methods available in linux to view the ip address

ifconfig :

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 516/798

g

-shows the ip address of the active interfaces withhardware address.

-it can show ip address of a particular interface by takinge n er ace name as argumen

example:

ifconfig eth0

ip a :

- simply shows the ip address of all interface.

Ifconfig command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 517/798

Displays

information ona current y

active interfaces.

Ifconfig command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 518/798

Here it displays

the information

of eth0 interface.

ip a command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 519/798

Here it displays the

information about allthe interfaces.

ifup / ifdown commandIfup:

-ifup command is used to activate the interfaces.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 520/798

Syntax:

 

Ifdown:

-ifdown command is used to deactivate the interface

Syntax:

ifdown <interfacename>

ifup / ifdown command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 521/798

It deactivate the

.

ifup / ifdown command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 522/798

Now you can notice

the interface eth0 isdeactivated.

ifup / ifdown command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 523/798

 

interface eth0.

ifup / ifdown command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 524/798

Now you can notice

the interface eth0 isactivated.

Assigning ip addressIn linux ip address can be assigned by the following methods.

netconfig:- to assign permanent ip address to the interface

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 525/798

Ifconfig:

- to assign temporary ip address to the interface.Syntax:

ifconfig <interfacename> <ipaddress> subnetmask<subnetmaskaddress> broadcast <broadcastaddress>

Ip a a :

- to assign additional ip address temporarily

Syntax:

ip a a <ip/subnetmaskaddress> dev <interfacename>

Assigning ip address

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 526/798

To assign permanent

i address usinnetconfig command.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 527/798

Assigning ip address

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 528/798

To assign ip

automatically

from dhcp server.

Assigning ip address

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 529/798

To assign ip

.

Assigning ip address

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 530/798

Using ifconfig

command ip

address can beassigned.

ip a command

s ows e

assigned ipaddress.

Assigning ip address

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 531/798

When network 

service is restarted,

As said earlier,

the ipaddress

assigned through

con g s use oassign ip address

temporarily.

 

device is removed.

Assigning ip address

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 532/798

To update ip

address thenetwork service is

restarted.

ip a command

assigned ip

address.

Assigning ip address

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 533/798

ip address can beassigned

temporary using

.

Assigning ip address

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 534/798

I address canbe removed

using

command, once

network service

s restarte t get

removed.

Router configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 535/798

The ip_forward file is

assigned 1 for enabling

the router or 0 for 

disabling.( Thisprocess for temporary.)

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 536/798

To enable the router

in permanent way get

into the s sct1.conf.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 537/798

The 1 is assigned to

enable the router and

this file is for setting

router in permanentmanner.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 538/798

Gateway can be added

using the command

route add.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 539/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 540/798

ping command

It is used to detect whether a system is up andrunning.

Syntax:

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 541/798

ping [options] <domainname>

ping [options] <ipaddress>

O tions:

a - audible pingb - to ping the broadcast address

c - s op sen ng pac e s a er coun .

ping command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 542/798

It checks whether

www.examp e.com

is up and connected

to the network.

ping command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 543/798

It checks whether192.168.0.253 machine

is u and connected to

the network.

ping command

-b option used

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 544/798

p

to ping aroa cast

address.

ping command

-c options stops

sending packets

ft th

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 545/798

after the

LVM Structure

• LVM structure

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 546/798

also known as extents, are organized into logical

groups, which are in turn used by logical volumes.

Physical volume

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 547/798

• It is nothing but hard disk partition that you create

with artition creation tools such as arted or fdisk.

• The partitions type can be any standard Linux

par ons ype, suc as ex or ex .

Volume groups

• Ph sical volumes are or anized into lo ical rou s,known as Volume groups 

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 548/798

• Volume groups that operate much like logical hard.

• You assign collection of physical volume to different

logical groups.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 549/798

lvm

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 550/798

LVM Configuration

Create partitionType p to check how

many partitions

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 551/798

using fdisk 

many partitions

command 

disk 

LVM Configuration

Here 4 partitionis created with

equal sizes of 

100mb through

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 552/798

100mb through

.

LVM Configuration

Newly created

partition is

listed below as

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 553/798

To know the

partition id, use

the option l.

LVM Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 554/798

 

lvm partition id.

LVM Configuration

Here below after‘ ’

the partition id is

changed to lvmTo change the

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 555/798

changed to lvmWe have topartition id as lvmmention the

hex code of 

the artition

id, use T option.

LVM Configuration

Now

partition id is

changed to

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 556/798

changed to

LVM Configuration

We save the lvm

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 557/798

artition throu hw option.

Previous versions of 

redhat needed to restartsystem after creating

.

version to avoid restart

we use partprobe.

LVM Configuration

Physical volume is

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 558/798

yPvdisplay command

partition(hda6.7.8&9)show the details of 

physical volume

LVM Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 559/798

pvdisplay command

dis la s the h sical

volume size.

LVM Configuration

Vgcreate creates

group as test0 forvgdisplay command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 560/798

g p a 0displays thevm part t oninformation about

volume group test0.

LVM Configuration

vcrea e crea es a

logical volume and we

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 561/798

assign name as data inthe test0 grouplvdisplay,

displays the

about logicalvolume.

LVM Configuration

,

an ext3 file

system for data.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 562/798

y

og ca vo ume

LVM Configuration

The logical volume

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 563/798

 /data directory.

Open fstab file forpermanently mounted

the logical volume data.

LVM Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 564/798

See thecontent of 

fstab file.

LVM Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 565/798

Logical volume name isdata is mounted on /data

directory permanently .

LVM Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 566/798

Here we can see free

space of logical volume

data.

LVM Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 567/798

Create a bi file of size

40mb in /data directory.Here we can see there isno free space available in

 /data directory .

LVM Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 568/798

Extend the logical volume

size u to 45mb usinNow create filesystem for

If the spacelvextend command.

e ex en e vo ume us ng

ext2online.After extending volume now

we see the free space

is not sufficient,

we can resize the

available in /data directory.

logical volume .

LVM Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 569/798

Here we can see only 12mb

free space ia available in

.

LVM Configuration

Now the screen

shows that test

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 570/798

increased to 200mb.Note that the total

allocated size for

,the space from

hdb7. 

100 mb.

LVM Configuration

The abovecommand shows

the increased

space of logical

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 571/798

.

LVM Configuration

Extend the lo ical volume

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 572/798

Extend the lo ical volumesize upto 50mb using

lvextend command.Now create filesystem for

e ex en e vo ume us ng

ext2online.After extending volume nowwe see the free space

available in /data directory.

LVM Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 573/798

We can remove logicalvolume first we must

(/data directory).

LVM Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 574/798

Remove the

mounted entr of  

logiacl volume

(data) in fstab file

LVM Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 575/798

After removing

lo ical volume save 

and exit the file.

LVM Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 576/798

Remove the logicalWe can remove volumeAfter deactivated the

rou will be removedvo ume name s a a

using lvremove

command.

 

decativate the volume

group using vgchange

using vgremove

command.comman .

RAID

• RAID means Redundant Arrays of Independent 

• RAID is a method of storing data across several

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 577/798

redundancy.

• ,

as just as one hard disk by your operating system.

Types of RAID

• RAID can be implemented on a

• Hardware level 

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 578/798

or 

• Software level 

Hardware RAID

• On a hardware level, you can have hard disk

connected to a RAID controller, usually a special

PC card.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 579/798

PC card.

though the RAID hardware controller.

Software RAID

• You can implement RAID as software controller,

letting a software RAID controller program.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 580/798

ett g a so t a e co t o e p og a

• The controller program manage access to hard

disks treated as RAID device.

RAID disk.

Software RAID Levels

RAID levels Capabilities Description

Linear Appending Simply treat RAID hard drives as one virtualdrive with no striping, mirroring.

0 Striping Implements disk stripping across drives with

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 581/798

p g p pp gno redundancy.

1 Mirroring Implements a high level of redundancy. Each

drive is treated as mirror for all data.

5 Distributed Parity Implements data reconstruction capabilityusing parity information. Parity information is

distributed across all drives.

RAID

rpm -q command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 582/798

p q

checks, whether the

mdadm installed

RAID

The partition is

created using

fdisk command.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 583/798

Now the screen lists

.

Raid Configuration

The partition is

created usingNow the screen lists

the artitions.fdisk command.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 584/798

Raid Configuration

4 Partitions is

option with equal

size of 100 mb

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 585/798

Raid Configuration

‘ ’ 

check created

partitions.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 586/798

The l option, lists the

file system. The fd

Raid Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 587/798

,

file system. The fddenotes linux raid

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 588/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 589/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 590/798

Raid Configuration

Using mdadm tool

creatin raid level 5 it usefour partition

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 591/798

 /dev/hda6,7,8&9 and

 /dev/md0.

Raid Configuration

Watch command

shows the online

status of raid

d i

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 592/798

devices.

Raid Configuration

Here we see statusof each raid disk.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 593/798

Raid Configuration

Creating ext3 file

system for raid device

 /dev/md0 using mke2fs

d

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 594/798

command.

Raid Configuration

Here we see the

ext3 file system is

created.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 595/798

Raid Configuration

mdadm –detail

command show the

detail information

about the raid

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 596/798

about the raid

.

Raid Configuration

Here we see each

raid disk major &Its show the raid

minor no. .raid disk active or

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 597/798

not active ).

Raid Configuration

Now raid device

(/dev/md0) is

mounted on /data

directory

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 598/798

directory.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 599/798

Raid Configuration

Now go to /data

directory and

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 600/798

directory and

name is file1 usingdd command.df command show

ree use space

for the raid devices

& partitions.

Raid Configuration

Mdadm –query

command show the

information about

particular raid device &

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 601/798

particular raid device &

.

Raid Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 602/798

Raid Configuration

Mdadm – manage

command set fault or

fail particular partitions

(/dev/hda9).Cat /proc/mdstat

d h di k

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 603/798

( 9)command show disk 

t e s s a e .

Raid Configuration

Here see mdadm –

 show disk /dev/hda9

is faulty

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 604/798

is faulty.

Raid Configuration

Now remove the

from the raid device

/dev/md0 using

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 605/798

 /dev/md0 using

a m –manage

command .

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 606/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 607/798

Raid Configuration

Watch command

shows the online

status of raiddevices.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 608/798

Raid Configuration

Here we can see the

status of online

synchronization of raid

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 609/798

y

.

Raid Configuration

Now the faulty

and we can

see the data.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 610/798

Raid Configuration

Here you can see

–command show disk 

 /dev/hda9 is active.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 611/798

Disk quota

Disk quota is used to control how much disk space a particular

user can access.

Quota tools:

uotacheck

quotaon

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 612/798

edquota

 

Quota tools

Quotacheck:

It scans the file system for the current disk usage and

update the aquota.user file.

Quotaon:

t turns on t e quota.

Quotaoff

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 613/798

.

Edquota:It is used to set disk uotas for a user.

Repquota:

It displays summary of disk quotas and and the quotausage .

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 614/798

Implementing quota

pen t e

fstab file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 615/798

Implementing quota

Replace this

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 616/798

defaults as

usrquota.

Implementing quota

Now usr uota

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 617/798

Now usr uota

is assigned to

the /home

.

Implementing quota

Here you can see thatRemount the

updated for the /home

directory.

ome rectory

to update.

Now ou can see the

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 618/798

Now ou can see the 

user quota got

assigned to /home

Implementing quota

Create quota

database file named

aquota.user to holdthe quota information

for all users.

It checks thevalidity of quota

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 619/798

 /home directory.

Implementing quota

Turn on the

quota.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 620/798

Implementing quota

Let us set disk 

quota for the

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 621/798

Implementing quota

To assign the

uota for the

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 622/798

user jack.

Implementing quota

The maximum memoryThis soft limit will justf Thi illh d

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 623/798

represents disk 

space in KB.

space for a user. This will

deny the user to access, if he exceeds the uota limit.

issue a warning if he

exceeds soft limit.Inode represents

number of files andfor the inode .To set hard

limit for inode.

rec or es can e

accessed by the user.

Implementing quota

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 624/798

Here we set softlimit as 40 KB Here we setHere we set hardlimit as 50 KB

Here we set hard limitas 20 inodes .so that

memory space .inodes .memory space .user can access only

max of 20 inodes.

Implementing quota

It dis la s

summary of 

disk usage.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 625/798

User jack has a hardlimit(block limits) of 50KBUser jack has a hard limit (filelimits) of 20 inodes and soft

and soft limit of 40 KB, he

already used 10KB.

limit of 15 inodes , he already

used 10 inodes.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 626/798

Implementing quota

Now, when the jack attemptto create more than ten files

. .,

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 627/798

write failed message occurs.

Implementing quota

 

command to create a file

named ‘1’ of 30KB.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 628/798

Since the user exceeds

the soft limits a warning

messages s occurre .

Implementing quota

 a file named ‘2’ of 10KB .

But since, he has exceeded

hard limit write failed

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 629/798

hard limit write failed

error occurred.

Implementing quota

ere we can no ce a

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 630/798

the jack had used all thisquota. So he is restricted

to create files.

mount command

Mount

It takes two argument : the storage

ev ce an e moun ng po n .The device is a special device file that

connects the system to the hardware device.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 631/798

co ects t e syste to t e a d a e de ce

Mounting point is directory on which the

storage device is to be mounted.

mount command

Syntax:

mount [options] <device> <mountpoint>

Options:

-w mount the file system with read/write permission.

-r mount the file system with read permission.

t t if th t f fil t t b t d

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 632/798

-t to specify the type of file system to be mounted.

-a mounts all the file systems listed in /etc/fstab.

umount command

It un mounts the mounted file system.

The removable media like floppy disk, and cd are un

mounted after use, by using umount command.

S t

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 633/798

Syntax:

umount <mount oint>

mounting CD-ROM

To mount the

CDROM on themounting point

 /mnt/cdrom

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 634/798

mounting CD-ROM

Now we can access

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 635/798

Now we can access

the CDROM contentsrom e moun ng

point.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 636/798

Unmounting cd-ROM

To eject the

CD from the

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 637/798

CD Drive.

Mount /unmount floppy

To mount the

floppy on themounting point

 /mnt/flo .

Unmount the

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 638/798

Unmount the

floppy after

access.

Mounting Hard drive partitions

To mount a hard drive artition

The hard disk partition also can be mounted like

any other file systems.

 

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 639/798

mount –t ext3 /dev/hda4 /mnt/data

Mounting Hard drive partitions

To mount the hard disk 

partition (hda3 of ext3file system) in /data

lists the mounted

device..

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 640/798

Mounting NFS

Mounting NFS (network file sharing) :

 – Before mountin we must know the files stem are ex orted b a

remote system. The following command is used to know the

directory shared.

showmount –e remote_server

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 641/798

 – When the host and share name are known, the following command

is used to connected the network file system to the local file system

tree

mount remoteserver:/shareddir /mnt/newdir1

Mounting NFS

Showmount command

displays the shareddirectory on

. . . . .

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 642/798

Mounting NFS

We mount the el

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 643/798

directory from remotemac ne n o our mn

directory .

Mounting NFS

Mount command

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 644/798

shows information'sabout mounted

devices.

Mounting NFS

 

to unmount remote

machine directory.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 645/798

Mounting smbfs

This command hel s to

view windows sharedfiles.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 646/798

Mounting smbfs

The above screensdisplays window shared

director .

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 647/798

Mounting smbfs

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 648/798

umount command used

to unmount remote

machine directory.

Auto mount /etc/fstab:

 

information in this file.

Using entries in this file the file system can be automatically

mounted whenever the system boots.

It consists of six field per line for each file system as follows

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 649/798

<device> <mountpoint> <fs_type> <options> <dump_freq>

<fsck_order>

Auto mount

pen t efstab file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 650/798

Auto mount

It representsIt representsIt represents fileIt representsIt represents the

.t e mount

i

systems.different options

f i h

ump

f

the fsck.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 651/798

points.for mounting thefile s stem.frequency.

AutofsAutofs service mounts the file system automatically

when the user access the mountin oint.

The autofs to supports the removable media without

recurr ng e user o o any ng more an nserthe media

Autofs configurations file are

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 652/798

 /etc/auto.master

 /etc/auto.misc

Autofs configurations files /etc/auto.master:

 

used for a file systems and that mounts will time out

a er secon s o nac ve.

 /etc/auto.misc:

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 653/798

 

file system is configured in this file.

Autofs configurations files

 

auto.master

fil

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 654/798

file.

Autofs configurations files

Mounting

'

should be entered

here

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 655/798

here.

Autofs configurations files

 

the mounting

point

information's about

the file systems to be

to unmounted the

auto mounted file

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 656/798

point.the file systems to beauto mounted filemounte .system.

Autofs configurations files

 

auto.misc file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 657/798

Autofs configurations files

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 658/798

Mounting device

information's are

entered here.

Autofs configurations files

K th fI h

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 659/798

Key, the name of It re resents thethe subdirectory

where the datasystem type.device to be

mounted.

.

Autofs configurations files

Now autofs serviceis restarted.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 660/798

Autofs configurations files

The contents of the

cdrom is now

available in the

mounting point

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 661/798

mounting point.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 662/798

Scheduling Task: cron

Cron Schedules one-time maintenance tasks.

Cron is ideal for setting up jobs that execute regularly atspec e mes or n erva s.

,up and configuring jobs.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 663/798

Creating cron

cron tab files are stored in /var/spool/cron.

s e s accesse on y y e roo user, w ereas eother users cannot access.

User can access this file by using crontab command.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 664/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 665/798

Scheduling Task: cron

Root user has the

privilege to open

this file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 666/798

Scheduling Task: cron

Now open

t e e.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 667/798

Scheduling Task: cronIf any

values isnot

represented

First fieldSecondThis filesThis fieldThis fieldComman

 

mention *

represents

minutes(0

-59 .

field

indicates

hours 0-

indicates,

day of the-

indicates

the month-

indicates

the day of 

d can be

given inThe above command gets

executed at 13 hours, 34

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 668/798

--23)

 

31)

 

week(0-6) 

minutes as daily basis at

same time.

Scheduling Task: cron

e serv ce s

restarted using

service crond

Chkconfig commandenables the crond

restart. 

in next boot time.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 669/798

Scheduling Task: cron

Automatically

“ ”

gets displayed in

terminal.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 670/798

Scheduling Task: cron

The permission is

denied to the normaluser  joe when the

user attempts to the

As said before the root user

.

only has the privilege to

access the file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 671/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 672/798

Scheduling Task: cron

Now open

t e e.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 673/798

Scheduling Task: cron

The above command gets

executed at 13 hours, 40

i d il b i

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 674/798

minutes as daily basis at

same time.

Scheduling Task: cron

Crontab –l command

used to display content of t b fil

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 675/798

crontab file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 676/798

DNS• DNS - Domain naming system.

• serv ce oca es an rans a es oma n namesinto corresponding associated IP addresses.

• DNS configuration.

• It requires the following software packages to be

installed.• n

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 677/798

n

• Caching-name server

• -

Service profile

- , - ,

caching-nameserver

Configuration files - /etc/named/named.conf

 /var/named/named.local

Daemons - namedPort number 53

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 678/798

Port number - 53

DNS Configuration

Install bind, thisInstall bind-utils

which rovides

package includesweb page manualsmany utilities likehost, dig and

Install caching-

name server which

provides a working

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 679/798

provides a working

named.conf 

DNS Configuration

Open this file for

mentioning the homedirectory for DNS.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 680/798

DNS Configuration

Here DNS home

directory is

 /var/named/chroot.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 681/798

DNS Configuration

 

directory files.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 682/798

DNS Configuration

Open the

file named.conf.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 683/798

DNS Configuration

Now ou are seeing the

contents of 

.

file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 684/798

DNS Configuration

Forward zone mapping

This file

contains the ip

between fully qualified

domain to particular ip

address and

the locations

of all the dot

servers.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 685/798

DNS Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 686/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 687/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 688/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 689/798

DNS Configuration

 

forward file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 690/798

DNS Configuration

Enter the fully

qualified name of It is interpreted as

the name of the

originating domain.Enter the authorisedEnter the fully

name server for this

zone.

qualified name of 

host.Enter the last numbersegment of the host

dd i th

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 691/798

address in the reverse

zone file.

DNS Configuration

 

fully qualified nameusing as given

e ow.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 692/798

DNS Configuration

Now the localhost is

replaced as

server1.example.com.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 693/798

DNS Configuration

Enter the ip address for

s ecified domain name.

Canonical name, is used

to define an alias for aos name. e www as

the cname for

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 694/798

the cname for

server1.example.com.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 695/798

DNS Configuration

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 696/798

DNS Configuration

Replace localhost to

server1.example.comusin as below.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 697/798

DNS Configuration

Now the localhost is

replaced by

server1.example.com.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 698/798

DNS Configuration

In a PTR record, you can

s ecif ust that last

number segment of the

address.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 699/798

DNS Configuration

Open the

resolve.conf file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 700/798

DNS Configuration

Mention the nameserver

ipaddress and domain

name here.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 701/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 702/798

DNS Configuration

Thus the DNS makes it possible toping an host by its domain name

by resolving the domain name

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 703/798

by resolving the domain name

.

DNS Configuration

Thus the DNS makes it possible toping an host by its domain name

by resolving the domain name

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 704/798

y g

.

DNS Configuration

g comman s ows p

address of the specified

f ll lifi d d i

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 705/798

fully-qualified domain

name .

DNS Configuration

Nslookup is a dns

query a dns server.Using nslookup you canidentifies nameserver forUsing nslookup you can

.identifies address for

particular FQDN.Using nslookup you can

identifies FQDN forparticular IP address.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 706/798

DNS Configuration

 

ping an host by its domain name

by resolving the domain name

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 707/798

by resolving the domain name

into IP address.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 708/798

DNS Configuration

In client side open

.

file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 709/798

DNS Configuration

Mention the nameserver

ipaddress and domain

name here.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 710/798

DNS Configuration

Thus the DNS makes it possible to

ping an host by its domain namey reso v ng e oma n name

into IP address.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 711/798

DNS Configuration

It shows the simple

lookup of host,thus its

show the correspondingi address to the

s ng ns oo up you can

identifies MX record forparticular domain.

specified fully quailed

domain name. 

identifies nameserver for

particular domain.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 712/798

p

DNS Configuration

 

forward file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 713/798

DNS Configuration

In this file we can add

additional entry MX(mail

In this file we can add

additional entr station105exc ange recor an s

corresponding ip address

192.168.0.100.

machine and its

corresponding ip address

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 714/798

192.168.0.100.. . .

DNS Configuration

pen t e

reverse file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 715/798

DNS Configuration

Similarly we can add

another pointer record105 for

station105.example.com.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 716/798

DNS Configuration

Now named

service is

restarted.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 717/798

DNS Configuration

s ng ns oo up you can

identifies MX record forparticular domain.Using nslookup you can

en es a ress or

particular FQDN.

Using nslookup you canen es recor or

particular FQDN.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 718/798

DNS Configuration

Open the

configurationfile named.conf.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 719/798

DNS Configuration

orwar zone sts t e

name servers outside the

network that should besearched when the

networks name server

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 720/798

.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 721/798

Apache Web Server• Apache web server:

• e pac e e server s a ree eserver developed by the Apache Server Project.

• It is a reliable, efficient , and easily extensible WebServer

• Free open source code

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 722/798

Apache Web Servermportant rector es an con gurat on es

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 723/798

Service profile

ac ages - p

-  .

Daemons - htt d

Portnumber - 80

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 724/798

Web server configuration

Query a httpd packagewhether installed or not 

but the screen shows

httpd packages is not

.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 725/798

Web server configuration

httpd package isinstalled usinNow query thepackage it show

rpm command.package is

installed.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 726/798

Web server configuration

Open the httpd

configuration file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 727/798

Web server configurationYou can see the first

,need to edit the end part

of the, so press shift+G

in command mode the

cursor will bottom of a e.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 728/798

Web server configurationThis screen show

end of httpd.conf 

file.

Copy the last

seven lines .

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 729/798

Web server configuration

Paste the copied

lines here .

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 730/798

Web server configuration

In virtual host field we

enter ipaddress or fully

qualified domain

ere spec y e e-maaddress of the

administrator for the web

Here specify the basedirectory from which

Here specify the

hostname for yourNow save and quit the

the htt d.conf file..

server.  ..server.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 731/798

Web server configuration

After editing the

service httpd is

restarted.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 732/798

Web server configuration

Creating index.html page

and lace this file in the /var/www/html/ directory.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 733/798

Web server configuration

Let us createAfter typing save

tm e .  .

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 734/798

Web server configuration

 

browser and type thefully qualified domain

name in address bar and

press enter, it will open

corres ondin web a e.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 735/798

Web server configuration

To allow only aDirectives that can beparticular user to access

our web site we can adddirector session inside

Setting up /var/www/html/ access

overridden by the entries

in an .htaccess file.

virtualhost session.control directive .

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 736/798

Web server configuration

.

 /var/www/html/ 

directory and open the

e

.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 737/798

Web server configurationThe authorization realm is

iven to the client so the

Type of user

authentication forSelects the authenticated

user knows which

username and password to

directory. only Basic and

Digest are currentlyThis file contain list of directory.

. .users and passwords for

user authentication.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 738/798

Web server configuration

Set the httpd

passwor or t e user

 joe .

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 739/798

Web server configuration

httpd password isstored in htpasswd

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 740/798

Web server configuration

Set full ermission for

the htpasswd file to

make sure that the user

permission .

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 741/798

Web server configuration

 

the htpasswd file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 742/798

Web server configuration

Restart the httpd

service.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 743/798

Web server configuration

Enter the fully qualifieddomain name in address

bar.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 744/798

Web server configuration

When we access the webpage the mozilla will

prompts for the

.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 745/798

Web server configuration

n er e username anthe password.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 746/798

Web server configuration

Now you can see theweb page.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 747/798

Access ControlThe web access can be controlled by using accesscontrol directives such as allow and deny.

Directive Description

deny from host Determines hosts that can access ahost …. given directory: all, or partial or full

domain name or ip address.

allow from hosthost ….

Determines which hosts can access agiven directory: all, or partial or fulldomain name or ip address.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 748/798

Web server configuration

This indicates that we

can access e we pagefrom any network.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 749/798

Web server configuration

o access e we pageonly from the above

specified network.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 750/798

Virtual host

Virtual hosts allow you to host multiple domains from a

single machine.

pac e suppor s wo eren ype o v r ua os s.

-

I -based virtual hosts

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 751/798

Ip and Named-based Virtual Hosts

IP-based virtual hosts

- p- ase v r ua os s are use w en a s ng emachine has several different IP address.

-To run a virtual host on each IP address.

Named-based virtual hosts

-It allow you to host many virtual hosts from asingle IP address.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 752/798

Name-based virtual hosts

Here we place twoTwo domains are

oma ns n a s ng e p

address and we canplace number of 

used in the name of 

example and test.com

domains using single

IP address.

 

192.168.0.20.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 753/798

Name-based virtual hosts

An i address is

mentioned in the

virtualhost field.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 754/798

Name-based virtual hosts

The server fully

qualified

described here.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 755/798

Name-based virtual hosts

A Directory is created

in the s ecified ath as above here copy

test.com webpage..

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 756/798

Name-based virtual hosts

ttp serv ce srestarted.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 757/798

Name-based virtual hosts

This is the webpage for

t e test.com .

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 758/798

Name-based virtual hosts

This is the webpage forexample.com.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 759/798

Proxy Server: SquidSquid

.

Handles the request from the local clients for

web access.

 

including FTP, Gopher ad HTTP.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 760/798

Service profile

Packages - Squid

Configuration files - /etc/squid/squid.conf

Daemons - Squid

-

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 761/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 762/798

Squid Configuration

 

configuration file if we

want to change the

e au s en we can ethe file.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 763/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 764/798

Squid Configuration

Search for the acl

access control list

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 765/798

Squid Configuration

Create another acl named

ano o res r c e we

access by time. Thus here the

web server can be accessed

during 18:30-19:30 only.Search for

http_access incomman mo e.

 

IP address are allowed to

access the web server by

ass gn ng em n acnamed thano.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 766/798

Squid Configuration

This deny other IP

addresses except the IP

access lists

o a ow e access s sthano and thano1

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 767/798

Squid Configuration

Now restart the

squidservice.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 768/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 769/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 770/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 771/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 772/798

Squid Configuration

Now the time is in

between the access timeiven in the acl so we

can access web server.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 773/798

Squid Configuration

Here you can see that

the access is denied

since the we are not

allowed to access the.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 774/798

Apache Encrypted Web Server

A ache can rovide encr ted communications usin 

the mod_ssl apache module.

To make use of encrypted communications, a client

must request the https protocol.

Encryption is based on either the RSA or DSA

.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 775/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 776/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 777/798

Apache Encrypted Web Server

To generate the

certificate signature

request.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 778/798

Apache Encrypted Web Server

The self signed certificate

can be installed using the

commandmake testcert.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 779/798

Apache Encrypted Web Server

When we restart the

httpd service it will

prompts for the

password.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 780/798

Apache Encrypted Web Server

Open the mozilla

browser and type fullyualified name in the

address bar using https

protocol.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 781/798

Apache Encrypted Web Server

Click here to

view the

certificate.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 782/798

Apache Encrypted Web Server

Here you can view thecertificate informations.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 783/798

Apache Encrypted Web Server

After examining accept the

certificate tem oraril or

permanent and then click 

ok.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 784/798

Apache Encrypted Web Server

You can see a warning

this page can not be read

by a third party.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 785/798

Apache Encrypted Web Server

ow you can accessthe web page securely.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 786/798

Sendmail ConfigurationSendmail:

e a nux uses en ma as s o e vermessages.

It listens for any mail messages received from other

hosts and address to user on the network host itserves.

,to be sent.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 787/798

Sendmail Service Profile

- -,

configuration file - /etc/mail/sendmail.mc

m4 macro config. file - /etc/mail/sendmail.cf

demon service - sendmail

ort number - 25 smt 110 o

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 788/798

Sendmail Configuration

Query is made to

check whether the

sendmail package is

installed. if not install

the packages.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 789/798

Sendmail Configuration

using rpm command.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 790/798

Sendmail Configuration

Open the sendmail

configuration file .

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 791/798

Sendmail Configuration

Sendmail

con gurat on e.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 792/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 793/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 794/798

Sendmail Configuration

e wor n s a e nthe beginning of this line

to comment.

commen ng s nevoids to send mail to the

other systems

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 795/798

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 796/798

Sendmail Configuration

Open the

Virtusertable file, for

domain addresses.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 797/798

Sendmail Configuration

The virutusertable

configuration helps to

along with fully

qualified domain name.

5/14/2018 Linux Slides1 to 800 [Compatibility Mode] - slidepdf.com

http://slidepdf.com/reader/full/linux-slides1-to-800-compatibility-mode 798/798

Sendmail Configuration

pen a oca -host-file.