Software(s/w)
-----------
software - set of programs
Program - set of coding or instruction or commands
Coding - How to execute our application(setp by step)
user real time problem-----------------------Systematic manner
Software
Ex1:
2+3--------------------------------systematic or device
calculator
Ex2 :
Search---------------------Systematic or device
Browser(Opera,Google chrome...)
Ex3:
chat------------------------Systemtic or device
Whatsapp,fb
Types of software
-----------------------
1. Application Software(apps)
2. System Software
1. Application Software
-----------------------------
-can visible
-user interaction(directly work with the user)
-request and response
-Windows based(GUI(Graphical User Interface) based)
Ex:
Word,Excel,Powerpoint,Paint,Photoshop,Player,Games,Calculator,Browser.....
2. System Software
------------------------
-System Programs(inbuild programs)
-cant visible
-backbone of application software
Ex:
1) OS 2) Translator 3) Device Drivers 4) Firmware
1) OS(Operating System)
---------------
-OS is a System Software
-OS is a System Programs
-brain of the computer
-control of system
-like input and output management (request and response)
-Memory Management
-File Management
-Resource Control management(USB,Keyboard,Mouse,Printer...)
User --------------- System software or Application software
OS
Ex: PC : Windows(XP,7,8,10,11), Unix, Linux, Mac, DOS---DOS Prompt(CUI - Character User Interface)--C,C++,Java,C#
Mobile : Android, IOS, Blackberry, Bada, Funtouch,Tizen,Colors---Smartphone OS
Keypad : Symbian
2) Translator
---------------
-Translator is a System Software
-Translator is a System Programs
-It converts source code to machine code
Source code--------------------------------Machine code
(user understand) Translator (binary code,(0,1),low level,object code,Target code)
(English)
Ex: Compiler, Interpreter, Assembler
Compiler
-------------
-Compiler is a translator
-Compiler is a System Software
-Compiler is a System Programs
-Error checking(check all lines)
Source code--------------------------------Machine code
(user understand) Compiler (binary code,(0,1),low level,object code,Target code)
(English)
Ex:
st1;
st2; //error
st3;
st4; //error
st5;
Compiler Result : error at 2 and 4
Interpreter
-------------
-Interpreter is a translator
-Interpreter is a System Software
-Interpreter is a System Programs
-convert line by line
Source code--------------------------------Machine code
(user understand) Interpreter (binary code,(0,1),low level,object code,Target code)
(English)
Ex:
st1;
st2; //error
st3;
st4; //error
st5;
Interpreter Result : error at 2
Assembler
--------------
-Assembler is a translator
-Assembler is a System Software
-Assembler is a System Programs
Assembly code --------------------------------Machine code
(user understand) Assembler (binary code,(0,1),low level,object code,Target code)
(English)
(Numonics) or Cryptic
(Microcontoller--Microchip)
Ex:
ADD,SUB,PRINT
==================================
OS
---
-Operating System
-OS is a System software or system programs
-brain of the computer
-Control of system
(input and output management)
(Resource Management)-Keyboard...
(Memory management)
(File management)
Ex(PC): Windows,DOS,Unix,Linux,Max
Mobile: Android,IoS,Windows,Bada,Tizen,Blackberry,Colors,Symbian
Linux
-------
-Developed by : Linus Torvalds
-Year : 1991 sep(1.0)
-Written in : C and Assembler
-License : GNU & GPL(General Public License)
-Kernal Based OS(Monolithic Space : Kernal Type) (.ko)
Features of Linux
---------------------
-Linux is a OS(Operating system)
-Linux is a OSS(Open Source Software- Free download, Free Use(free Lic), Source Code Available)
-Linux is a Multiuser(Share multiple User) & Multitask OS
-Linux is a NOS(Network Operating System)
-Linux Shell based(program) & Desktop Based OS (GUI)
-OS is a System Software
-OS is a System Programs
-brain of the computer
-control of system
-like input and output management (request and response)
-Memory Management
-File Management
-Resource Control management(USB,Keyboard,Mouse,Printer...)
===================================
Uses of Linux
----------------
-Cloud Computing
-Embedded Devices
-Mainframe Computers
-Mobile Devices
-Personal Computers
-Servers
-Super Computers
-Routers
-Automation Controls
-TV
-Digital Video Recorders
-Video Games Controller
-Smartwatches
-Tablets
-cars
-Refrigerators
-Laptops & Desktop PC
===============================
Apllications of Linux
-------------------------
-Dell inspiration mini
-Google Android
-HP mini
-Motorola motoRokr
-Sony Bravia TV
-Volvo car(Navigation System)
-Yamaha motit Keyboard
==============================
Linux Distribution(Distro) -- Linux Version ***
--------------------------
Desktop (GUI Based)--Window --Execute Our application software
---------
-Fedora
-Linux Mint
-Debian
-SUSE Linux
-Ubuntu
Shell Based --Execute our Programming
--------------
-RED Hat Linux
-Gentoo
-Canonical
-Slack ware Linux
-Caldera Linux
-Mandrake Linux
-CentOS
-Mandriva
-ArchLinux
===================================
Linux Architecture
-----------------------
1. Hardware
2. Kernel
3. Shell
4. Applications
1. Hardware
-Physical components of computer
Ex: Harddisc, RAM,ROM,Motherboard,Terminals
2. Kernel
-extension : .ko
-locate : /lib/modules
-Its is a OS
-brain of the computer
-system software or system programs
-control of system
(like input and output management
Resource management, File,Memory)
-schedule management
3. Shell
-Its is a CLI(Command Line Interface) or CUI(character User Interface)
-It is used to execute programs
-Variables,Arrays and fucntion,strings manipualtion
-Arithmetic and Logical calculations
Different types of shell
----------------------------
1. Bourne Shell (.sh) - logical and arithmetic calculation
2. C shell (.csh) - Arithmetic and expression
3. TC Shell(.tcsh) - C Shell & Word Processing
4. Korn Shell (ksh) - Arithmetic, Functions, Arrays and strings
5. GNU Bourne (Again Shell)(.bash)- default linux shell
4. Applications
-Window or desktop application
-GUI format
-end user applications
-user interaction(request and response)
Ex:
Player,Browser, Text Editors, Database
=================================
variable
-----------
Comment line
----------------
1. single line comment -- one line decription or author name,program title
#
2. Multiline comment -- paragraph format
'''
'''
#Program 1 : Display your name
echo "welcome to Linux"
#Program 2 : Add two numbers
a=10
b=20
c=$(($a+$b))
echo "Result is : $c"
#Program 3 : Add two numbers
echo "Enter a :"
read a
echo "Enter b :"
read b
c=$(($a+$b))
echo "Result is : $c"
#Program 3 : Add two numbers
echo -n "Enter a :"
read a
echo -n "Enter b :"
read b
c=$(($a+$b))
echo "Result is : $c"
1. simple interest calc
2. volume of spehere
3. cone
4. cylinder
5. area of circle
6. area of triangle
=====================================================
Control structure
----------------------
-flow the control of execution
-chnage(skip or repeate) the order of execution
Types
-------
1. Conditional statement
2. unconditional statement
3. looping statement
1. conditional statement
-------------------------------
1. if statement
a. simple if
b. simple if else
c. elif ladder
d. nested if
2. case..esac statement
if statement
---------------
-To check the given conditon is true or false
Types
-------
1. simple if
2. simple if else
3. elif ladder
4. nested if
1. simple if
-------------
-To check the given condition is true
-prsent true part only
syntax:
---------
if [ condition ]
then
statement
fi
Working
----------
step1 : to check the given condition
step2: if the given condition is true than execute true part statement
otherwise exit from if statement
#to check +ve
echo "Enter the value of n :"
read n
if [ $n -gt 0 ]
then
echo "The given no is +ve"
fi
-------------------------
2. simple if else
-------------
-To check the given condition is true or false
-prsent true part and false part
syntax:
---------
if [ condition ]
then
statement
else
statement
fi
Working
----------
step1 : to check the given condition
step2: if the given condition is true than execute true part statement
otherwise execute else part statement
#to check +ve or -ve
echo "Enter the value of n :"
read n
if [ $n -gt 0 ]
then
echo "The given no is +ve"
else
echo "The given no is -ve"
fi
-------------------------
echo "enter the value of n"
read n
n1=$(($n%2))
if [ $n1 -eq 0 ]
then
echo "The given no is even"
else
echo "The given no is odd"
fi
-------------------------
3. elif ladder
----------------
-check more than one condition
syntax:
-------
if [condition1]
then
elif [condition2]
then
statement
elif [condition3]
then
statement
else
statement
fi
Working
----------
step1 : to check the given condition
step2: if the given condition is true than execute true part statement
step3: otherwise to check another elif condition
step4: suppose all condition are flase then execute else part statement
#ex
echo "enter the value of n"
read n
if [ $n -eq 1 ]
then
echo "Good mor"
elif [ $n -eq 2 ]
then
echo "Good noon"
elif [ $n -eq 3 ]
then
echo "Good eve"
elif [ $n -eq 4 ]
then
echo "Good nt"
else
echo "Invalid input try again"
fi
-----------------
4. nested if
--------------
-one if contain another if
syntax:
---------
if [condition]
then
statement
if[condition]
then
statement
else
statement
---------------
Working
----------
step1 : to check the given condition
step2: if the given condition is true than execute true part statement
step3: otherwise to check another if condition
step4: suppose all condition are flase then execute else part statement
#ex1
echo "enter the value of n"
read n
n1=$(($n%4))
n2=$(($n%400))
if [ $n1 -eq 0 ]
then
if [ $n2 -eq 0 ]
then
echo "leap year"
else
echo "not leap"
fi
else
echo "not leap year"
fi
-----------------
4. case..esac statement
-------------------------------
-multiway branching statement
-choice based system
-single exp but more than one case value
syntax:
--------
case exp in
pattern1) statement1;;
pattern2) statement2;;
pattern3) statement3;;
...
*) statement;;
esac
working
------
step1 : to check the given condition and pattern
step2: if the given condition is true than execute pattern1 statement
step3: otherwise to check another pattern condition
step4: suppose all pattern are flase then execute else part(*) statement
#ex: case..esac
echo "Enter the value of n :"
read n
case $n in
1) echo "one";;
2) echo "two";;
3) echo "three";;
*) echo "invalid";;
esac
----------------------------------
Looping statement or repeativity or iteration
----------------------
-set of statement is repeated until condition is false
Types
-------
1. for
2. while
3. until ------not support do while
1. for
------
-set of statement is repeated until condition s false
-entry controlled loop(first check the condition,next execute statement)
syntax1:
---------
for var in{start..end}
do
statement
done
syntax2:
---------
for((initilization;condition;increment or decrement))
do
statement
done
working
----------
step1: initilized the given variable
step2: check the given conidition,if the condition is true than execute statement
(suppose condition is false than exit from looping statement)
step3: next goto increment part
#ex1
for((i=1;i<5;i++))
do
echo "welcome"
done
#ex2
for i in {1..5}
do
echo "welcome"
done
2. while
---------
-set of statement is repeated until condition is false
-entry controlled loop(first check the condition,next execute statement)
syntax:
-------
while(condition)
do
statement
done
working
----------
step1: initilized the given variable
step2: check the given conidition,if the condition is true than execute statement
(suppose condition is false than exit from looping statement)
step3: next goto increment part
#while
i=1
while(($i < 5))
do
echo "welcome"
i=$(($i+1))
done
3. until
---------
-set of statement is repeated until condition is true
syntax:
--------
until(condition)
do
statement
done
#Ex1
i=1
until(($i>5))
do
echo "welcome"
i=$(($i+1))
done
======================
break
-----
-break is a unconditional statement
-Exit from loop
syntax:
---------
for((initilization;condition;increment or decrement))
do
if(condition)
then
break
fi
done
Ex:
---
for i in {1..5}
do
if [ $i = 3 ]
then
break
fi
echo "welcome"
done
continue
----------
-continue is a unconditional statement
-ignore(skip) current iteartion
syntax:
---------
for((initilization;condition;increment or decrement))
do
if(condition)
then
continue
fi
done
Ex:
---
for i in {1..5}
do
if [ $i = 3 ]
then
continue
fi
echo "welcome"
done
=====================================================
Assignment Topics
----------------------
1). Linux features,Uses,Applications & Linux Distrbutions(Distro)
2). Linux Architecture
3). Define Variable and Types of variable(Shell Variable & Environment Variable(System variable)),
Rules for naming a variable
4). Conditional statements (or) branching Statement
1. if statements
a. simple if
b. simple if else
c. elif ladder
d. Nested if
2. case..esac statements
3. Looping statements
a. for loop
b. while loop
c. until loop
4.difference between break and continue
-----------------------------
5). Explain Vi editor & Vi commands (mode of vi editor) & Different Access mode codes
6). Substitution Command, File Mask & Root in Linux
7). Linux files and directory commands
8). Explain File listing commands & wc commands
9). Explain Filter commands
10). Explain tee commands & Redirection commands & Pipes commands
11). Palindrome checking program
12). sum of the individual digits
13). factorial calculation program
----------------------