Top Banner
LINUX PROGRAMMING AND ADMINISTRATION PRESENTED BY HARISH.R
91
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction to Linux

LINUX PROGRAMMING AND ADMINISTRATION

PRESENTED BY

HARISH.R

Page 2: Introduction to Linux

OVERVIEW OF PRESENTATION

INTRODUCTION TO UNIX AND LINUX

FILES AND DIRECTORIES IN LINUX

INSTALLATION IN LINUX

BASIC COMMANDS

USER AND GROUP ADMINISTRATION

LILO

Page 3: Introduction to Linux

UNIX

Page 4: Introduction to Linux

HISTORY OF UNIX

MULTICS

UNICS

UNIX

Started in 1965 by AT & T, GE MIT

Created by Ken Thompson in 1969

Written in 100% C Language and released in 1973

Page 5: Introduction to Linux

UNIX

Commercial products

1. SunOS, Solaris

2. HP-UX

3. AIX

4. SCO UNIX

Page 6: Introduction to Linux

What is GNU / UNIX

A free Unix-type operating system developed under the

GNU General Public License.

Open source

Popular

Support most of the platforms available

Page 7: Introduction to Linux

General Characteristics of UNIX

Multi-user & Multi-tasking

Over 30 Years Old.

Large Number of Applications

Page 8: Introduction to Linux

FLAVOURS OF UNIX

These can be grouped into two categories: Open Source and Proprietary

Proprietary: (redistribution and modification prohibited or restricted; not free)

Solaris

IRIX

Mac OS X

Open Source: (source code is readily available and free to modify)

RedHat

Debian

SuSE

Slackware

Page 9: Introduction to Linux

History of LINUX

In Sept 1991, Linus Torvalds, a second year student of

Computer Science at the University of Helsinki, developed the

preliminary kernel of Linux, known as Linux version 0.0.1

Page 10: Introduction to Linux

CHARACTERISTICS OF LINUX

is a Unix-like computer operating system

Predominantly known for its use in servers.

supported by corporations such as Dell, Hewlett-Packard, IBM, Novell, Oracle

Corporation, Red Hat, and Sun Microsystems

Page 11: Introduction to Linux

USED AS AN OPERATING SYSTEM

Computer hardware

desktop computers

supercomputers

Video game players

PlayStation 2

PlayStation 3

Several Arcade Games

Embedded devices

Mobile Phones

Routers

Wristwatches

Stage lighting systems

Page 12: Introduction to Linux

Where might you find Linux?

Page 13: Introduction to Linux

LINUX DISTRIBUTION

Red Hat Linux

Open Linux

Debian GNU/Linux

SuSE Linux

Mandrake Linux

Slackware

Page 14: Introduction to Linux

LINUX DISTRIBUTION

Page 15: Introduction to Linux

Features of Linux

OPEN SOURCE: Free Software along with source code and Documentation.

MULTITASKING: Capable of running multiple application and process at the same time.

MULTIPLE-USER: Allow Multiple user to login and use the resources at same time.

PORTABILITY : Can be installed on all hardware architecture.

Page 16: Introduction to Linux

Features of Linux

SCALABILITY : Same Operating Systems can be used on a desktop to a Super Computer.

RELIABILITY : Large Server have been successfully being running without a single second of down time.

Page 17: Introduction to Linux

USER INTERFACE

Linux can be controlled by

text-based command line interface (CLI)

graphical user interface (GUI) (usually the default for desktop)

through controls on the device itself (common on embedded machines)

On desktop machines, KDE, GNOME and Xfce are the most popular user interfaces

Page 18: Introduction to Linux

File system hierarchy standard (fhs)

/

bootroot bin

optdevusrsbinhom

e

mediaetcvar

Page 19: Introduction to Linux

LINUX INSTALLATION

Page 20: Introduction to Linux

WHAT IS A PARTITION

A partition is a means of dividing your hard disk into multiple sections,

each of which is treated as a separate disk by your operating system.

This allows you to be able to boot different operating systems from the

same disk, for example, Linux and Windows.

Partitions cannot be moved or resized without destroying the data on

them.

Page 21: Introduction to Linux

WHAT IS A FILE SYSTEM

File systems can be considered as being the directory

structures on a disk partition that contains all the files.

Most Windows users would be familiar with the analogous

terms "folders" and "subfolders", whereas Linux users would be

familiar with the terms "directories" and "sub-directories".

Page 22: Introduction to Linux

/boot partition

The /boot partition contains the Linux kernel which is the "master

control program", not only for controlling the boot process, but also

the normal functioning of Linux.

Redhat Linux creates this partition automatically. This reduces the

need to reformat the "root" partition if it becomes corrupted.

Page 23: Introduction to Linux

SWAP PARTITION

Used as a location to place data temporarily if RAM memory becomes full.

Red Hat automatically creates this partition and usually makes it about

twice the amount of system RAM.

To create swap partition

]#fdisk /dev/partition name

N=new

L=logical

Page 24: Introduction to Linux

SWAP PARTITION

Format swap

]#mkswap /dev/partition name and ID

To on the swap

]#swapon /dev/partition name and ID

Page 25: Introduction to Linux

HARDWARE REQUIREMENTS

PROCESSOR MINIMUM RECOMMENDED

RAMTEXT 96 MB 256 MB

GUI 128 MB 512 MB

HARD DISK

TEXT 1 GB As per requirement

GUI 3 GB As per requirement

Page 26: Introduction to Linux

RECOMMENDED PARTITIONS

Partitions Size

/boot 100 MB

/ 3000 MB

/usr 6000 MB

/var 2000 MB

/home 2000 MB

swap Twice the RAM ( Minimum 4 GB )

Page 27: Introduction to Linux

Red hat installation

Page 35: Introduction to Linux

DUAL BOOT UBUNTU INSTALLATION

Page 40: Introduction to Linux

BASIC COMMANDS IN LINUX

Page 41: Introduction to Linux

Print working directory

Print the name of the current working directory

[root@comp~]# pwd

Page 42: Introduction to Linux

List of files and directories

Options:

-l Long list including attributes

-a All files and directories including hidden.

-d For a particular file or directory.

-R Recursive to see the tree.

To see the list of files and folders

[root@comp~]# ls <options> <arguments>

Page 43: Introduction to Linux

Creation of files

Files can be created by using any of the three methods given below:

Cat command

Touch command

Vi editor

Page 44: Introduction to Linux

Cat (concatenation command)

To create a file

[root@comp~]# cat > <filename>

To view the contents of the file

[root@comp~]# cat <filename>

Page 45: Introduction to Linux

Touch command

To create a zero byte file

[root@comp~]# touch <filename>

To create a multiple zero byte file

[root@comp~]# touch <first file> <second file> <third file>

Page 46: Introduction to Linux

Vi editor

To create a file

[root@comp~]# vi <filename>

Page 47: Introduction to Linux

Creating a directories

To create multiple directories

[root@comp~]# mkdir <first dir> <second dir> <third dir>

To create a directory

[root@comp~]# mkdir <file name>

Page 48: Introduction to Linux

Copying

Options:

-r Recursive

-v Verbose

-p Copy with permissions

To copying a file or directory

[root@comp~]# cp <options> <source file> <destination file>

Page 49: Introduction to Linux

Moving and renaming

To move a file or directory to a different locations

[root@comp~]# mkdir <source file or directory> <destination>

Rename a file or directory

[root@comp~]# mv <old name> <new name>

Page 50: Introduction to Linux

Deleting

Options

-r Recursive

-f forcefully

To remove or delete an empty directory

[root@comp~]# rmdir <dir name>

To remove or delete a file or directory

[root@comp~]# rm <options> <file or dir name>

Page 51: Introduction to Linux

Other commands

To see the date

[root@comp~]# date

To see the calender

[root@comp~]# cal

Page 52: Introduction to Linux

Vi EDITORS

Page 53: Introduction to Linux

Editors

Editors are used for adding, modifying and / or deleting text.

The different editors used

• Windows :notepad

• LINUX / UNIX zx

1.CLI Based : EX, ED, VI

2.GUI based : Emacs, Gedit, nedit, nano, pico

Page 54: Introduction to Linux

Vi Editors

Vi editors is a screen oriented text editors written by Bill joy in 1976.

This is the most commonly used editor for editing files in Linux.

Page 55: Introduction to Linux

Vi editor modes

Vi editors has three modes of operations

Command modeInsert modeEx mode

Page 56: Introduction to Linux

Insert mode

i - Inserts the text at the current cursor position.

I - Inserts the text in beginning of line.

a - Adds the text after the current cursor position.

A - Adds the text at the end of the line.

o - Insert the text one line below current cursor point.

O - Insert the text one line above current cursor point.

Page 57: Introduction to Linux

Command mode

dd - Deletes a line. ndd - Deletes ‘n’ lines. yy - Copies a lines. nyy - Copies ‘n’ lines. p - Put (Paste the deleted or

copied text). u - Undo (you can undo 1000 times)

Page 58: Introduction to Linux

Ex mode

:q - Quit without saving. :w - Write(save). :wq - Save and quit. :se nu - Set line numbers. :se nonu - Remove line numbers. :88 - This cursor goes to line

84.

Page 59: Introduction to Linux

USER ADMINISTRATION

Page 60: Introduction to Linux

Users

In computing, a user is a person who uses a computer or internet service.

A user will have a user account that identifies the user by a user name.

To logon a system, a user is required to authenticate himself with a password for the purposes of accounting, security, logging.

Page 61: Introduction to Linux

Users

Red hat Linux uses a User private group scheme

When a user is created a group with the same as the user name is also created.

This becomes the primary group.

A user can have only primary group.

Page 62: Introduction to Linux

Users

When a user is created in UNIX and LINUX, the following are also created by default.

Home directory /home/[username]

Mail account /var/spool/mail/[username]

Unique user identifier (UID) and the Group Identifier (GID).

Page 63: Introduction to Linux

Creating a user

Adding a user

[root@comp~]# useradd <username>

Or

[root@comp~]# useradd <options> <arguments> <username>

Page 64: Introduction to Linux

Options for creating user

Options:

-u UID

-c Comment

-g Primary group name

-G Secondary group name

-d Home directory

Page 65: Introduction to Linux

User password

Creating or changing a user password

[root@comp~]# passwd <username>

Page 66: Introduction to Linux

Modifying a user

Options:

-l Change the login name.

-L Lock the account.

-U Unlock the account.

Modifying user properties

[root@comp~]# usermod <options> <arguments> <username>

Page 67: Introduction to Linux

Deleting a user

Options:

-r Recursively

Deleting a user

[root@comp~]# userdel <options> <arguments> <username>

Page 68: Introduction to Linux

GROUP ADMINISTRATION

Page 69: Introduction to Linux

Group

Group is a collection of user to whom the same permission are to be applied.

There are two types of groups

1. Primary

2. Secondary

Page 70: Introduction to Linux

Creating a group

Options:

1. -g GID

Creating a group

[root@comp~]# groupadd <group name>

Or

[root@comp~]# groupadd <options> <arguments> <group name>

Page 71: Introduction to Linux

Modifying a group

Options:

-g GID

-n Group Name

Modifying a group

[root@comp~]# groupmod <options> <arguments> <group name>

Page 72: Introduction to Linux

Deleting a group

Deleting a group

[root@comp~]# groupdel <options> <arguments> <username>

Page 73: Introduction to Linux

ACCESS PERMISSIONS

Page 74: Introduction to Linux

Access Permissions

There are three defined categories of users.

The categories are:

owner — The owner of the file or application.

others — All users with access to the system.

group — The group that owns the file or application.

Page 75: Introduction to Linux

Access permissions

There are three permissions for any file, directory or application program.

The following lists the symbols used to denote each, along with a brief description:

r — Indicates that a given category of user can read a file.

w — Indicates that a given category of user can write to a file.

x — Indicates that a given category of user can execute the file.

Page 76: Introduction to Linux

LILO

Page 77: Introduction to Linux

Introduction to LILO

LILO or Linux Loader is a boot loader for Linux.

A boot loader is a small program that exists in the system and loads the operating

system into the system’s memory when the system boots.

Boot loader also starts the operating system.

Page 78: Introduction to Linux

LILO

LILO is a flexible boot loader for Linux, which is independent of a file system.

LILO loads itself into the computer’s memory in two stages

Stage1 – This stage, also known as primary boot loader is read into

memory by the BIOS from the master boot record

Stage 2 - This stage, also known as secondary boot loader is read into memory and it displays the Red Hat Linux initial screen

Page 79: Introduction to Linux

Configuring LILO

To install LILO, it is necessary to know the location of /boot partition.

It is also necessary to know the location of other installed operating systems

LILO can be installed for the first time using a shell script named QuickInst

LILO can be uninstalled using the lilo –u command

Page 80: Introduction to Linux

NETWORK FILE SYSTEM (NFS)

A network file system is any computer file system that support sharing of files over a computer network..

It is a centralized file storage system.

The client cannot differentiate whether the file is stored locally or remotely.

Page 81: Introduction to Linux

NETWORK FILE SYSTEM (NFS)

The Nfs Environment Contains The Following Components:

Nfs Server

- A System That Contains The File Resources To Be Shared With Other System Over The Network.

Nfs Cilent

- A System That Mounts The File Resources Shared Over The Network And Presents The File Resources As If They Were Local

Page 82: Introduction to Linux

DISK QUOTAS

Quotas are used to restrict the amount of hard disk spaces occupied by a user.

Page 83: Introduction to Linux

BACKUP

Backup is copy of data on a computer system.

,

Backup Levels

1. Level 0

2. Level 1

3. Level 2

Page 85: Introduction to Linux

Software tools in LINUX

Office Productivity suites

1. Applix ware

2. Star office

3. Corel office

Graphical tools

GIMP

Page 86: Introduction to Linux

File Transfer Protocol

File transfer protocol (FTP) is one of the oldest member of the TCP/IP protocol stack and is still in common use.

As the name suggests, it is optimized for transferring files.

Page 87: Introduction to Linux

FTP Server for LINUX

vsFTP Very Secure FTP Daemon

WU-FTP Washington University’s (St. Louis)

Proftpd Professional FTP Daemon

Page 88: Introduction to Linux

FTP Commands

ls

cd

put

mput

get

mget

bye

Page 89: Introduction to Linux

DIFFERENCE BETWEEN LINUX AND MICROSOFT

LINUX

Cost: Open Source, freely downloaded from Internet.

Usage: installed on a wide variety of computer hardware, ranging from mobile phones, tablet computers and video game consoles, to mainframes and supercomputers.

MICROSOFT

Cost: Windows can be expensive. Cost around $50 to $ 450 depending on the version of Windows.

Usage: On PC's desktops, laptops, servers and some phones.

Page 90: Introduction to Linux

File System: Ext2, Ext3, Ext4, Jfs, ReiserFS, Xfs, Btrfs, FAT, FAT32, NTFS

Developer/Company : Linus Torvalds

License: GNU/Free

Security: Linux has had about 60-100 viruses listed till date. None of them actively spreading nowadays.

Examples: Redhat, Ubuntu, Fedora, Boss, Debian, Mint

File System: FAT, FAT32, NTFS, exFAT

Developer/Company: Microsoft

License: Proprietary

Security: There have been more than 60,000 viruses in Windows. Anti Virus cost about $20 to $400.

Examples: Windows XP, Windows 7, Windows 8/8.1,

Page 91: Introduction to Linux

Thank you