[go: up one dir, main page]

0% found this document useful (0 votes)
50 views28 pages

Linux

The document provides an overview of the UNIX operating system, including its history, core principles, architecture, features, flavors, and importance compared to Windows. Some key points covered include that UNIX treats everything as a file, uses small single-purpose programs chained together, and has a multi-user, multi-tasking design. The architecture includes a kernel that controls resources and a shell that acts as an interpreter between the user and kernel. The document also discusses UNIX security features like file permissions and users/groups, and provides examples of common UNIX commands.

Uploaded by

rvpshome
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views28 pages

Linux

The document provides an overview of the UNIX operating system, including its history, core principles, architecture, features, flavors, and importance compared to Windows. Some key points covered include that UNIX treats everything as a file, uses small single-purpose programs chained together, and has a multi-user, multi-tasking design. The architecture includes a kernel that controls resources and a shell that acts as an interpreter between the user and kernel. The document also discusses UNIX security features like file permissions and users/groups, and provides examples of common UNIX commands.

Uploaded by

rvpshome
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 28

1

presented by

Vijay
2

WHAT IS UNIX ?
UNIX is an operating system which is available
as Open source

Introduced by KEN THOMSON

UNiplexed
UN Information Computing Systems
(UNICS)

Later it is called as UNIX


3

UNIX PRINCIPLES

Everything is a FILE ( including Hardware )


Small, Single purpose programs
Ability to chain programs together to perform
complex tasks ( ‘PIPE’
PIPE )
Configuration data stored in text
4

UNIX Architecture
USER App/Prog

Shell

Kernel

Heart of OS
Hard ware

Cont…
5

 Kernel

• it controls the system resources and


allocates them to different users
• it decide process priorities

 Shell
• technically it is a program
• it is an Interpreter b/w user & kernel
• it takes i/p from user and checks weather the
command is proper UNIX command or not
6

Unix FEATURES
Multiuser
Multitasking
Documentation
Security
7

Flavours of UNIX
LINUX ( Redhat )
SUN SOLARIES ( Sun Microsystems )
IBM SIX ( IBM )
HP –UX ( HP )
8

IMPORTANCE
UNIX WINDOWS

• Multiuser & multitasking OS • Singleuser & singletasking OS


• In this we can set file • Cannot
permissions
• Processor will be in protected • It will be not
mode
• Virus threats is not present in • It has so many threats for
UNIX viruses
• It has hierarchical file system • It doesn’t have
• It has High Security • Doesn’t
9

Situation
A project team of 5 people of ABC is working on a s/w development project,
The team is headed by Analyst, the other are all programmers

Each programmer has given a few programs to develop

The data is of ABC are highly confidential

One programmer may have to link his program with another programmer's
Program in order to test his program
10

Security by FAP
 The following security related features are stored against each
file/directory in a UNIX system.

• The owner of the file


• The group that the file belongs to
• The permissions that various parties have to access the file.
• There are three sets of permissions
• The access privileges of the owner of the file
• The access privileges of any members of the file group
• The access privileges of everyone else.

Cont….
11

• drwxr-xr-x 2 user group 1250 Jun 22 13:02 <filename/dirname>

• The 3 letters are r,w and x


• r -------------- read (ls)
• w------------- modify or write (create or delete)
• x-------------- execute(access)

r = 4
w = 2
x = 1
No permission = 0
Cont…..
12

PERSONS ACTIONS PERMISSIONS

u owner + add r read

g group - remove w write

O others = set x execute

a All

Cont….
13

chmod command
• chmod u-x,g+w,o-x file1 (symbolic mode)

• chmod 756 file1 (numeric mode)


14

SYNTAX of the Commands

Commands have the following syntax

 command <options> <arguments>

• Options will modify a command’s behavior


• Arguments are filenames or other data needed
by command
• Multiple commands can be separated by ‘ ; ’
15

Getting HELP

Many levels of help

 Whatis
 Command --help
 man
16

Creation of Users & Groups


• useradd user1
• groupadd group1
• useradd –G group1 user2
• usermod –G group1 user1
• usermod -a –G group2 user1

• id user1
17

Change the Owner & Group ownerships


for FILES

• Chown user <filename>


• Chown -R user <filename>

• Chgrp user <filename>


• Chgrp -R user <filename>
18

Basic Commands
• pwd [$pwd]
• cd [$cd path]
• ls [$ls <options> <file>]
l,a,i,s,r,R,
• more [$more <file>]
• head [$head <options> <file>]
n
• tail [$tail <options> <file>]

cont…..
19

• cat [$cat <file>]


(>,<,2>,&>,>>,<<)
• mkdir [$mkdir <options> <dir> ]
p
• cp [$cp <source file> <target file>]
• mv [$mv <source file> <target file>]
• rm [$rm <options> <file>]
f,r
• rmdir [$rmdir <options> <dir>]
• wc [$wc <options> <file>]
(l,w,c)
• nl [$nl <file>]
cont….
20

• cut [$cut <options> <field list> <file>


f(1,3)
• paste [$paste <file1> <file2>]
• uniq [$uniq <file>]
• sort [$sort <file>]
• tr [$tr <expr_1> <expr_2> <file>]

Cont…..
21

• find [$find <path> <category> <argument>]


name,iname,size,perm,user,group
• grep [$grep <options> <pattern> <file>]
b,c,i,l

• ps [$ps <options>]
e,f
• kill [$kill <signal> pid]
15,9
• pkill [$pkill <signal> <pattern>]

Cont….
22

PIPE
 pipe ( | )

 cat /etc/passwd | wc –l

 cat /etc/passwd | tee file | wc –l | mail


xyz@acp.com
23

Vi Editor
Vi file1
• i  inserts at cursor’s position
• I  inserts at beginning of the record
• a  inserts at cursor’s next character
• A  inserts at ending of the record
• o  make a new line below the cursor’s
position & enters
• O  make a new line above the cursor’s
position & enters
Cont…..
24

Write/quit commands
• w  write
• wq  write and quit
25

Shell script
• It is an ordered collection of meaningful UNIX
commands.

 Types of shells
Bourne shell
Korn shell
Perl shell
Pythan shell
26

Shell script file


$ vi file.sh
• clear
• echo “ enter the ‘a’ value”
• read a
• echo “ enter the ‘b’ value”
• read b
• echo “$a + $b = ‘expr $a + $b’ ”
• echo “$a + $b = ‘expr $a - $b’ ”
• Wq Cont….
27

How to run Shell script


• sh file.sh
• ./file.sh
28

You might also like