SlideShare una empresa de Scribd logo
1 de 46
• A program or a software that governs the functioning of
other programs
• Interface between User and the Hardware
• Allocates resources for tasks
• Allocates tasks to programs
• Manages space and time
• Controls the devices
• Tasks
• Uni tasking
• Multi tasking
• Users
• Single User
• Multi User
• Processing
• Uni processing
• Multi processing
• Timesharing
• Free Open Source Software
• Free – Means Liberty and not related to Price or cost
• Open – Source code is available and any body can
contribute to the development. Organization independent
• Core or nucleus of an operating system
• Interacts with the hardware
• First program to get loaded when the system starts and
runs till the session gets terminated
• Different from BIOS which is hardware dependent.
• Kernel is software dependent
• Monolithic
• All OS related code are stuffed in a single module
• Available as a single file
• Advantage : Faster functioning
• Micro
• OS components are isolated and run in their own
address space
• Device drivers, programs and system services run
outside kernel memory space
• Supports modularity
• Lesser in size
• Program that interacts with kernel
• Bridge between kernel and the user
• Command interpreter
• User can type command and the command is conveyed
to the kernel and it will be executed
• Sh – simple shell
• BASH – Bourne Again Shell
• KSH – Korne Shell
• CSH – C Shell
• SSH – Secure Shell
• To use a particular shell type the shell name at the command
prompt.
• Eg $csh – will switch the current shell to c shell
• To view the available shells in the system, type cat /etc/shells at the
command prompt
• To view the current shell that is being used, type echo $SHELL at
the command prompt
• Freedom to run the software anywhere
• Freedom to study how the programs work. i.e source
code will be accessible
• Freedom to redistribute copies
• Freedom to improve the software
• If a software has all these 4 freedoms, then it is a FOSS
• Termed by Richard Mathew Stallman
• Liberates information from the proprietary legal
encumbrances associated with conventional co pyrig ht
• Co pyle ft state m e nt:
• “Ve rbatim co pying and re distributio n are pe rm itte d in any m e dium
pro vide d this no tice is pre se rve d. ”
• Multics – 1964
• Unics – 1969
• Minix – 1990
• Linux – 1991
• Multiplexed Information and Computing Service
• Written in 1964
• Timesharing OS
• Last version was shut down on October 30, 2008
• Monolithic kernel
• Uniplexed Information and Computing System
• Later renamed as UNIX
• Written in 1969
• Ken Thompson, Dennis Ritchie were among the
developers
• Multi user, Multi tasking and timesharing
• Monolithic kernel
• Minimal Unix
• Tanenbaum developed this OS
• Mainly for educational purpose
• Unix like OS, implemented with Micro kernel. So the
name Minix
• Developed in 1991 by Linus Torvalds
• Used in most of the computers, ranging from
super computers to embedded system
• Multi user
• Multi tasking
• Time sharing
• Monolithic kernel
• Founded by Richard Stallman in 1983
• Organisation that started developing copylefted programs
• Project – GNU Project
• GNU Not Unix
• Recursive expansion
User 1
User 2
• Redhat
• Fedora
• Debian
• Novell’s SUSE Linux
• Ubuntu
• Mandrake
• Live CDs – Knoppix and more
• Only the kernel is called by the name Linux
• The rest are the tools developed under GNU Project
• Hence the name GNU/Linux
• Vi
• Emacs
• gEdit
• kWrite
• TextPad
• And more…
• Mozilla
• First Open source browser
• Released from Netscape group
• Firefox
• High performance, feature rich, standards based web browser
• Sea Monkey
–Integrated web application suite derived from
the mozilla source code
• mkdir - creating directory
• mkdir dirname
• rmdir – removing directory and its contents
• rmdir dirname
• cd – Change directory
• cd dirpath
• cp – Copying files
• cp file1 file2
• mv – Moving or renaming files
• mv oldfile newfile
• ln – Creating links between files
• ln file1 file2
• Difference between copying files and linking files
• cp src dst
• Contents of src will be present in dst
• Changing content in src will not affect contents of dst and vice versa
• ln src dst
• Contents of src will be present in dst
• Changing content in src or dst will get reflected in the other file
• Help about commands
• man, pinfo, info (man <<cmd name>>)
• Viewing file’s content
• cat <<filename>>
• Viewing users, processes
• who – List all Users
• who am I – List the current user
• pstree – displays all processes running in the system in tree
format
• ps – displays processes owned by the current user
• Changing file permission/owner
• chmod – changes file permission
• chown – changes file owner
• Listing files in a directory
• ls – Lists all files in a directory
• ls –a – Lists all files (including hidden files)
• ls –l – Lists files in a directory along with owner
information, permission etc
• Terminal Emulator
• xterm – Generates a terminal
• xterm –fg color –bg color –rightbar : Generates a
terminal with the specified background and foreground
color and a scroll bar on the right side
• Popular text editor
• Just type vi <<filename>> at the prompt and hit the enter
key.
• A new file will be opened
• Type the contents needed and save
• To save, press the Esc Key and then press : (colon) w q
and then enter
• To quit with out saving Esc + : + q and then enter
• Navigation
• Left - h
• Down - j
• Up - k
• Right - l
• Top of the screen – H (shift + h) //caps lock will not work
• Middle of the screen – M (shift + m)
• Bottom of the screen – L (shift + l)
• $ - End Key, 0 – Home Key
• Edit Commands
• Cut – X, x
• Copy – yy, yw
• Paste – P, p
• grep – GNU Regular Expression Processor
• Finds the words / patterns matching with the search and
displays the line containing the patterns.
• Search is limited to a file
• Redirection
• Input redirection
• wc < file1 – Content of file 1 is given as input for wc command
that counts the no of lines, words and characters in a file
• Output redirection
• cat file > newfile – Copies file’s content to newfile. Over writes
the existing content
• cat file >> newfile – Appends the new content to the existing
content
• Pipes
• Output of first command is input for the second and so on
• who | wc –l – Number of lines in the output of who command will
be displayed
• Open a file with extension .c from the command prompt using vi
editor
• vi hello.c
• Type the contents and save (Esc : wq!)
• Compile the file
• gcc hello.c
• Run the executable
• ./a.out
• Compile file with output option
• gcc –o hello hello.c
• Run the executable
• ./hello
• Shell scripting is the most useful and powerful feature in
Linux
• Minimizes typing of repetitive command
• Can schedule jobs to run in the system
• Can initiate back up activities for system administration
• Similar to batch files in DOS, but more powerful than Batch files
• Open a file with extension .sh using vi editor
• We can type any number of commands that we use to
type at command prompt
• Save the file
• Execute the file
• sh file.sh
• ./file.sh (if the file has execution permission)
• To Print a line
• echo “Hello World” (Prints Hello World in the screen)
• To read a line
• read n (Stores the content entered by user in variable n
• To Comment a line
• # This is a comment
• Only single line comment is available. For multi line
comment, we need to use # symbol in lines which we
want to comment.
• For loop
for i in 1 2 3 4 5 //Loops 5 times
do
Body of the loop
done
for (( i=0; i<5; i++ ))
do
Body of the loop
done
while [ condn ]
do
body of the loop
done
We need to ensure that the while loop condition is
terminated in a finite way
• We can have if, if else, if elif else and case statements (Nested if
statements are also possible
1. if [ condn ]
then
fi
2. if [ condn ]
then
else
fi
3. if [ condn ]
then
elif [ condn ]
then
else
fi
case expr in
Option1) stmt ;;
Option2) stmt ;;
*) stmt ;;
esac
• Every option should be terminated with a double
semicolon.
• Denotes default case
• Case should be termniated with esac
• For integer comparison we have the following
-eq : equal to
-ne : not equal to
-lt : less than
-gt : greater than
-le : less than or equal to
-ge : greater than or equal to
• For string comparison we have
- = : equal to
- ~= : not equal to
• For logical operators
-a : AND
-o : OR
• Initialising an array
• A[0] = 10
• A[1] = Hi
• Using an array
• ${A[0]} : retrieves 10
• Here arrays can contain data belonging to
different data types
• Uninitialised index in arrays will have null value
by default
• Local Function
• Written at the command prompt
• Lasts for the current session alone
• Global Function
• Written in .bashrc file
• Available as long as the definition is there in .bashrc file
• Function in shell script
• Available with in the file alone
• Sample function
Functionname()
{
echo $1
}
Calling function:
Functionname Ram
Result:
Ram
• We can view the environment variables through
set or env command
• The set command will display all the global
functions written by the user
• The env command displays only the variables
and not the functions
• We can reassign values for the variables either
temporarily or permanently
• Temporary
• Type varname=value at the command prompt
• Permanent
• Type varname=value in .bashrc at the root directory
• Alias – Alternate name for an entity
• Entity here refers to command
• We can give another name or alias name for a
command either at the command prompt or in
the .bashrc file.
• The former will be temporary and will vanish if
the session ends and the latter will be permanent
as long as the definition exists in the .bashrc file
• alias newname=oldname
• Eg alias co py= cp
• Then we can use copy in the same way we use
cp command
• Eg co py file 1 file 2 //copies content of file1 to file2
• To remove alias use unalias command
• unalias co py
• After this we cannot use copy to perform copying
function

Más contenido relacionado

La actualidad más candente

Embedded Systems: Lecture 11: Introduction to Git & GitHub (Part 2)
Embedded Systems: Lecture 11: Introduction to Git & GitHub (Part 2)Embedded Systems: Lecture 11: Introduction to Git & GitHub (Part 2)
Embedded Systems: Lecture 11: Introduction to Git & GitHub (Part 2)Ahmed El-Arabawy
 
Course 102: Lecture 10: Learning About the Shell
Course 102: Lecture 10: Learning About the Shell Course 102: Lecture 10: Learning About the Shell
Course 102: Lecture 10: Learning About the Shell Ahmed El-Arabawy
 
Ericas-Linux-Plus-Study-Guide
Ericas-Linux-Plus-Study-GuideEricas-Linux-Plus-Study-Guide
Ericas-Linux-Plus-Study-GuideErica StJohn
 
OpenZFS code repository
OpenZFS code repositoryOpenZFS code repository
OpenZFS code repositoryMatthew Ahrens
 
AOS Lab 2: Hello, xv6!
AOS Lab 2: Hello, xv6!AOS Lab 2: Hello, xv6!
AOS Lab 2: Hello, xv6!Zubair Nabi
 
Course 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsCourse 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsAhmed El-Arabawy
 
Realizing Linux Containers (LXC)
Realizing Linux Containers (LXC)Realizing Linux Containers (LXC)
Realizing Linux Containers (LXC)Boden Russell
 
Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2) Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2) Ahmed El-Arabawy
 
Course 102: Lecture 9: Input Output Internals
Course 102: Lecture 9: Input Output Internals Course 102: Lecture 9: Input Output Internals
Course 102: Lecture 9: Input Output Internals Ahmed El-Arabawy
 
Embedded Systems: Lecture 5: A Tour in RTOS Land
Embedded Systems: Lecture 5: A Tour in RTOS LandEmbedded Systems: Lecture 5: A Tour in RTOS Land
Embedded Systems: Lecture 5: A Tour in RTOS LandAhmed El-Arabawy
 
Introduction to-linux
Introduction to-linuxIntroduction to-linux
Introduction to-linuxkishore1986
 
Buildroot easy embedded system
Buildroot easy embedded systemBuildroot easy embedded system
Buildroot easy embedded systemNirma University
 
Course 102: Lecture 20: Networking In Linux (Basic Concepts)
Course 102: Lecture 20: Networking In Linux (Basic Concepts) Course 102: Lecture 20: Networking In Linux (Basic Concepts)
Course 102: Lecture 20: Networking In Linux (Basic Concepts) Ahmed El-Arabawy
 
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs Sam Bowne
 
CNIT 127 Ch 6: The Wild World of Windows
CNIT 127 Ch 6: The Wild World of WindowsCNIT 127 Ch 6: The Wild World of Windows
CNIT 127 Ch 6: The Wild World of WindowsSam Bowne
 

La actualidad más candente (20)

Linux
LinuxLinux
Linux
 
Embedded Systems: Lecture 11: Introduction to Git & GitHub (Part 2)
Embedded Systems: Lecture 11: Introduction to Git & GitHub (Part 2)Embedded Systems: Lecture 11: Introduction to Git & GitHub (Part 2)
Embedded Systems: Lecture 11: Introduction to Git & GitHub (Part 2)
 
Course 102: Lecture 10: Learning About the Shell
Course 102: Lecture 10: Learning About the Shell Course 102: Lecture 10: Learning About the Shell
Course 102: Lecture 10: Learning About the Shell
 
Ericas-Linux-Plus-Study-Guide
Ericas-Linux-Plus-Study-GuideEricas-Linux-Plus-Study-Guide
Ericas-Linux-Plus-Study-Guide
 
OpenZFS code repository
OpenZFS code repositoryOpenZFS code repository
OpenZFS code repository
 
UNIX Basics and Cluster Computing
UNIX Basics and Cluster ComputingUNIX Basics and Cluster Computing
UNIX Basics and Cluster Computing
 
Linux programming - Getting self started
Linux programming - Getting self started Linux programming - Getting self started
Linux programming - Getting self started
 
AOS Lab 2: Hello, xv6!
AOS Lab 2: Hello, xv6!AOS Lab 2: Hello, xv6!
AOS Lab 2: Hello, xv6!
 
Course 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsCourse 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and Permissions
 
Intro to Python programming and iPython
Intro to Python programming and iPython Intro to Python programming and iPython
Intro to Python programming and iPython
 
Linux Programming
Linux ProgrammingLinux Programming
Linux Programming
 
Realizing Linux Containers (LXC)
Realizing Linux Containers (LXC)Realizing Linux Containers (LXC)
Realizing Linux Containers (LXC)
 
Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2) Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2)
 
Course 102: Lecture 9: Input Output Internals
Course 102: Lecture 9: Input Output Internals Course 102: Lecture 9: Input Output Internals
Course 102: Lecture 9: Input Output Internals
 
Embedded Systems: Lecture 5: A Tour in RTOS Land
Embedded Systems: Lecture 5: A Tour in RTOS LandEmbedded Systems: Lecture 5: A Tour in RTOS Land
Embedded Systems: Lecture 5: A Tour in RTOS Land
 
Introduction to-linux
Introduction to-linuxIntroduction to-linux
Introduction to-linux
 
Buildroot easy embedded system
Buildroot easy embedded systemBuildroot easy embedded system
Buildroot easy embedded system
 
Course 102: Lecture 20: Networking In Linux (Basic Concepts)
Course 102: Lecture 20: Networking In Linux (Basic Concepts) Course 102: Lecture 20: Networking In Linux (Basic Concepts)
Course 102: Lecture 20: Networking In Linux (Basic Concepts)
 
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs
 
CNIT 127 Ch 6: The Wild World of Windows
CNIT 127 Ch 6: The Wild World of WindowsCNIT 127 Ch 6: The Wild World of Windows
CNIT 127 Ch 6: The Wild World of Windows
 

Similar a Operating System and Shell Scripting Fundamentals

Similar a Operating System and Shell Scripting Fundamentals (20)

redhat_by_Cbitss.ppt
redhat_by_Cbitss.pptredhat_by_Cbitss.ppt
redhat_by_Cbitss.ppt
 
Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01
 
PowerPoint_merge.ppt on unix programming
PowerPoint_merge.ppt on unix programmingPowerPoint_merge.ppt on unix programming
PowerPoint_merge.ppt on unix programming
 
Linux: Everyting-as-a-service
Linux: Everyting-as-a-serviceLinux: Everyting-as-a-service
Linux: Everyting-as-a-service
 
Unix _linux_fundamentals_for_hpc-_b
Unix  _linux_fundamentals_for_hpc-_bUnix  _linux_fundamentals_for_hpc-_b
Unix _linux_fundamentals_for_hpc-_b
 
Unix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptxUnix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptx
 
Introduction to UNIX
Introduction to UNIXIntroduction to UNIX
Introduction to UNIX
 
Linux
LinuxLinux
Linux
 
Linuxnishustud
LinuxnishustudLinuxnishustud
Linuxnishustud
 
Linux Knowledge Transfer
Linux Knowledge TransferLinux Knowledge Transfer
Linux Knowledge Transfer
 
UNIX/Linux training
UNIX/Linux trainingUNIX/Linux training
UNIX/Linux training
 
LINUX_admin_commands.pptx
LINUX_admin_commands.pptxLINUX_admin_commands.pptx
LINUX_admin_commands.pptx
 
Unix/Linux
Unix/Linux Unix/Linux
Unix/Linux
 
2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx
 
Linux week 2
Linux week 2Linux week 2
Linux week 2
 
Unix
UnixUnix
Unix
 
CSA-lecture 6.pptx
CSA-lecture 6.pptxCSA-lecture 6.pptx
CSA-lecture 6.pptx
 
System Programming and Administration
System Programming and AdministrationSystem Programming and Administration
System Programming and Administration
 
Systems Programming - File IO
Systems Programming - File IOSystems Programming - File IO
Systems Programming - File IO
 
Linux Basics.pptx
Linux Basics.pptxLinux Basics.pptx
Linux Basics.pptx
 

Más de QUONTRASOLUTIONS

Big data introduction by quontra solutions
Big data introduction by quontra solutionsBig data introduction by quontra solutions
Big data introduction by quontra solutionsQUONTRASOLUTIONS
 
Cognos Online Training with placement Assistance - QuontraSolutions
Cognos Online Training with placement Assistance - QuontraSolutionsCognos Online Training with placement Assistance - QuontraSolutions
Cognos Online Training with placement Assistance - QuontraSolutionsQUONTRASOLUTIONS
 
Business analyst overview by quontra solutions
Business analyst overview by quontra solutionsBusiness analyst overview by quontra solutions
Business analyst overview by quontra solutionsQUONTRASOLUTIONS
 
Business analyst overview by quontra solutions
Business analyst overview by quontra solutionsBusiness analyst overview by quontra solutions
Business analyst overview by quontra solutionsQUONTRASOLUTIONS
 
Software Quality Assurance training by QuontraSolutions
Software Quality Assurance training by QuontraSolutionsSoftware Quality Assurance training by QuontraSolutions
Software Quality Assurance training by QuontraSolutionsQUONTRASOLUTIONS
 
Introduction to software quality assurance by QuontraSolutions
Introduction to software quality assurance by QuontraSolutionsIntroduction to software quality assurance by QuontraSolutions
Introduction to software quality assurance by QuontraSolutionsQUONTRASOLUTIONS
 
.Net introduction by Quontra Solutions
.Net introduction by Quontra Solutions.Net introduction by Quontra Solutions
.Net introduction by Quontra SolutionsQUONTRASOLUTIONS
 
Introduction to j2 ee patterns online training class
Introduction to j2 ee patterns online training classIntroduction to j2 ee patterns online training class
Introduction to j2 ee patterns online training classQUONTRASOLUTIONS
 
Saas overview by quontra solutions
Saas overview  by quontra solutionsSaas overview  by quontra solutions
Saas overview by quontra solutionsQUONTRASOLUTIONS
 
Sharepoint taxonomy introduction us
Sharepoint taxonomy introduction   usSharepoint taxonomy introduction   us
Sharepoint taxonomy introduction usQUONTRASOLUTIONS
 
Introduction to the sharepoint 2013 userprofile service By Quontra
Introduction to the sharepoint 2013 userprofile service By QuontraIntroduction to the sharepoint 2013 userprofile service By Quontra
Introduction to the sharepoint 2013 userprofile service By QuontraQUONTRASOLUTIONS
 
Introduction to SharePoint 2013 REST API
Introduction to SharePoint 2013 REST APIIntroduction to SharePoint 2013 REST API
Introduction to SharePoint 2013 REST APIQUONTRASOLUTIONS
 
Performance Testing and OBIEE by QuontraSolutions
Performance Testing and OBIEE by QuontraSolutionsPerformance Testing and OBIEE by QuontraSolutions
Performance Testing and OBIEE by QuontraSolutionsQUONTRASOLUTIONS
 
Obiee introduction building reports by QuontraSolutions
Obiee introduction building reports by QuontraSolutionsObiee introduction building reports by QuontraSolutions
Obiee introduction building reports by QuontraSolutionsQUONTRASOLUTIONS
 
Sharepoint designer workflow by quontra us
Sharepoint designer workflow by quontra usSharepoint designer workflow by quontra us
Sharepoint designer workflow by quontra usQUONTRASOLUTIONS
 

Más de QUONTRASOLUTIONS (20)

Big data introduction by quontra solutions
Big data introduction by quontra solutionsBig data introduction by quontra solutions
Big data introduction by quontra solutions
 
Java constructors
Java constructorsJava constructors
Java constructors
 
Cognos Online Training with placement Assistance - QuontraSolutions
Cognos Online Training with placement Assistance - QuontraSolutionsCognos Online Training with placement Assistance - QuontraSolutions
Cognos Online Training with placement Assistance - QuontraSolutions
 
Business analyst overview by quontra solutions
Business analyst overview by quontra solutionsBusiness analyst overview by quontra solutions
Business analyst overview by quontra solutions
 
Business analyst overview by quontra solutions
Business analyst overview by quontra solutionsBusiness analyst overview by quontra solutions
Business analyst overview by quontra solutions
 
Cognos Overview
Cognos Overview Cognos Overview
Cognos Overview
 
Hibernate online training
Hibernate online trainingHibernate online training
Hibernate online training
 
Java j2eeTutorial
Java j2eeTutorialJava j2eeTutorial
Java j2eeTutorial
 
Software Quality Assurance training by QuontraSolutions
Software Quality Assurance training by QuontraSolutionsSoftware Quality Assurance training by QuontraSolutions
Software Quality Assurance training by QuontraSolutions
 
Introduction to software quality assurance by QuontraSolutions
Introduction to software quality assurance by QuontraSolutionsIntroduction to software quality assurance by QuontraSolutions
Introduction to software quality assurance by QuontraSolutions
 
.Net introduction by Quontra Solutions
.Net introduction by Quontra Solutions.Net introduction by Quontra Solutions
.Net introduction by Quontra Solutions
 
Introduction to j2 ee patterns online training class
Introduction to j2 ee patterns online training classIntroduction to j2 ee patterns online training class
Introduction to j2 ee patterns online training class
 
Saas overview by quontra solutions
Saas overview  by quontra solutionsSaas overview  by quontra solutions
Saas overview by quontra solutions
 
Sharepoint taxonomy introduction us
Sharepoint taxonomy introduction   usSharepoint taxonomy introduction   us
Sharepoint taxonomy introduction us
 
Introduction to the sharepoint 2013 userprofile service By Quontra
Introduction to the sharepoint 2013 userprofile service By QuontraIntroduction to the sharepoint 2013 userprofile service By Quontra
Introduction to the sharepoint 2013 userprofile service By Quontra
 
Introduction to SharePoint 2013 REST API
Introduction to SharePoint 2013 REST APIIntroduction to SharePoint 2013 REST API
Introduction to SharePoint 2013 REST API
 
Performance Testing and OBIEE by QuontraSolutions
Performance Testing and OBIEE by QuontraSolutionsPerformance Testing and OBIEE by QuontraSolutions
Performance Testing and OBIEE by QuontraSolutions
 
Obiee introduction building reports by QuontraSolutions
Obiee introduction building reports by QuontraSolutionsObiee introduction building reports by QuontraSolutions
Obiee introduction building reports by QuontraSolutions
 
Sharepoint designer workflow by quontra us
Sharepoint designer workflow by quontra usSharepoint designer workflow by quontra us
Sharepoint designer workflow by quontra us
 
Qa by quontra us
Qa by quontra   usQa by quontra   us
Qa by quontra us
 

Último

Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxleah joy valeriano
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 

Último (20)

Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 

Operating System and Shell Scripting Fundamentals

  • 1.
  • 2. • A program or a software that governs the functioning of other programs • Interface between User and the Hardware • Allocates resources for tasks • Allocates tasks to programs • Manages space and time • Controls the devices
  • 3. • Tasks • Uni tasking • Multi tasking • Users • Single User • Multi User • Processing • Uni processing • Multi processing • Timesharing
  • 4. • Free Open Source Software • Free – Means Liberty and not related to Price or cost • Open – Source code is available and any body can contribute to the development. Organization independent
  • 5. • Core or nucleus of an operating system • Interacts with the hardware • First program to get loaded when the system starts and runs till the session gets terminated • Different from BIOS which is hardware dependent. • Kernel is software dependent
  • 6. • Monolithic • All OS related code are stuffed in a single module • Available as a single file • Advantage : Faster functioning • Micro • OS components are isolated and run in their own address space • Device drivers, programs and system services run outside kernel memory space • Supports modularity • Lesser in size
  • 7. • Program that interacts with kernel • Bridge between kernel and the user • Command interpreter • User can type command and the command is conveyed to the kernel and it will be executed
  • 8. • Sh – simple shell • BASH – Bourne Again Shell • KSH – Korne Shell • CSH – C Shell • SSH – Secure Shell • To use a particular shell type the shell name at the command prompt. • Eg $csh – will switch the current shell to c shell • To view the available shells in the system, type cat /etc/shells at the command prompt • To view the current shell that is being used, type echo $SHELL at the command prompt
  • 9. • Freedom to run the software anywhere • Freedom to study how the programs work. i.e source code will be accessible • Freedom to redistribute copies • Freedom to improve the software • If a software has all these 4 freedoms, then it is a FOSS
  • 10. • Termed by Richard Mathew Stallman • Liberates information from the proprietary legal encumbrances associated with conventional co pyrig ht • Co pyle ft state m e nt: • “Ve rbatim co pying and re distributio n are pe rm itte d in any m e dium pro vide d this no tice is pre se rve d. ”
  • 11. • Multics – 1964 • Unics – 1969 • Minix – 1990 • Linux – 1991
  • 12. • Multiplexed Information and Computing Service • Written in 1964 • Timesharing OS • Last version was shut down on October 30, 2008 • Monolithic kernel
  • 13. • Uniplexed Information and Computing System • Later renamed as UNIX • Written in 1969 • Ken Thompson, Dennis Ritchie were among the developers • Multi user, Multi tasking and timesharing • Monolithic kernel
  • 14. • Minimal Unix • Tanenbaum developed this OS • Mainly for educational purpose • Unix like OS, implemented with Micro kernel. So the name Minix
  • 15. • Developed in 1991 by Linus Torvalds • Used in most of the computers, ranging from super computers to embedded system • Multi user • Multi tasking • Time sharing • Monolithic kernel
  • 16. • Founded by Richard Stallman in 1983 • Organisation that started developing copylefted programs • Project – GNU Project • GNU Not Unix • Recursive expansion
  • 18.
  • 19. • Redhat • Fedora • Debian • Novell’s SUSE Linux • Ubuntu • Mandrake • Live CDs – Knoppix and more
  • 20. • Only the kernel is called by the name Linux • The rest are the tools developed under GNU Project • Hence the name GNU/Linux
  • 21. • Vi • Emacs • gEdit • kWrite • TextPad • And more…
  • 22. • Mozilla • First Open source browser • Released from Netscape group • Firefox • High performance, feature rich, standards based web browser • Sea Monkey –Integrated web application suite derived from the mozilla source code
  • 23. • mkdir - creating directory • mkdir dirname • rmdir – removing directory and its contents • rmdir dirname • cd – Change directory • cd dirpath • cp – Copying files • cp file1 file2 • mv – Moving or renaming files • mv oldfile newfile
  • 24. • ln – Creating links between files • ln file1 file2 • Difference between copying files and linking files • cp src dst • Contents of src will be present in dst • Changing content in src will not affect contents of dst and vice versa • ln src dst • Contents of src will be present in dst • Changing content in src or dst will get reflected in the other file
  • 25. • Help about commands • man, pinfo, info (man <<cmd name>>) • Viewing file’s content • cat <<filename>> • Viewing users, processes • who – List all Users • who am I – List the current user • pstree – displays all processes running in the system in tree format • ps – displays processes owned by the current user • Changing file permission/owner • chmod – changes file permission • chown – changes file owner
  • 26. • Listing files in a directory • ls – Lists all files in a directory • ls –a – Lists all files (including hidden files) • ls –l – Lists files in a directory along with owner information, permission etc • Terminal Emulator • xterm – Generates a terminal • xterm –fg color –bg color –rightbar : Generates a terminal with the specified background and foreground color and a scroll bar on the right side
  • 27. • Popular text editor • Just type vi <<filename>> at the prompt and hit the enter key. • A new file will be opened • Type the contents needed and save • To save, press the Esc Key and then press : (colon) w q and then enter • To quit with out saving Esc + : + q and then enter
  • 28. • Navigation • Left - h • Down - j • Up - k • Right - l • Top of the screen – H (shift + h) //caps lock will not work • Middle of the screen – M (shift + m) • Bottom of the screen – L (shift + l) • $ - End Key, 0 – Home Key • Edit Commands • Cut – X, x • Copy – yy, yw • Paste – P, p
  • 29. • grep – GNU Regular Expression Processor • Finds the words / patterns matching with the search and displays the line containing the patterns. • Search is limited to a file
  • 30. • Redirection • Input redirection • wc < file1 – Content of file 1 is given as input for wc command that counts the no of lines, words and characters in a file • Output redirection • cat file > newfile – Copies file’s content to newfile. Over writes the existing content • cat file >> newfile – Appends the new content to the existing content • Pipes • Output of first command is input for the second and so on • who | wc –l – Number of lines in the output of who command will be displayed
  • 31. • Open a file with extension .c from the command prompt using vi editor • vi hello.c • Type the contents and save (Esc : wq!) • Compile the file • gcc hello.c • Run the executable • ./a.out • Compile file with output option • gcc –o hello hello.c • Run the executable • ./hello
  • 32. • Shell scripting is the most useful and powerful feature in Linux • Minimizes typing of repetitive command • Can schedule jobs to run in the system • Can initiate back up activities for system administration • Similar to batch files in DOS, but more powerful than Batch files
  • 33. • Open a file with extension .sh using vi editor • We can type any number of commands that we use to type at command prompt • Save the file • Execute the file • sh file.sh • ./file.sh (if the file has execution permission)
  • 34. • To Print a line • echo “Hello World” (Prints Hello World in the screen) • To read a line • read n (Stores the content entered by user in variable n • To Comment a line • # This is a comment • Only single line comment is available. For multi line comment, we need to use # symbol in lines which we want to comment.
  • 35. • For loop for i in 1 2 3 4 5 //Loops 5 times do Body of the loop done for (( i=0; i<5; i++ )) do Body of the loop done
  • 36. while [ condn ] do body of the loop done We need to ensure that the while loop condition is terminated in a finite way
  • 37. • We can have if, if else, if elif else and case statements (Nested if statements are also possible 1. if [ condn ] then fi 2. if [ condn ] then else fi 3. if [ condn ] then elif [ condn ] then else fi
  • 38. case expr in Option1) stmt ;; Option2) stmt ;; *) stmt ;; esac • Every option should be terminated with a double semicolon. • Denotes default case • Case should be termniated with esac
  • 39. • For integer comparison we have the following -eq : equal to -ne : not equal to -lt : less than -gt : greater than -le : less than or equal to -ge : greater than or equal to
  • 40. • For string comparison we have - = : equal to - ~= : not equal to • For logical operators -a : AND -o : OR
  • 41. • Initialising an array • A[0] = 10 • A[1] = Hi • Using an array • ${A[0]} : retrieves 10 • Here arrays can contain data belonging to different data types • Uninitialised index in arrays will have null value by default
  • 42. • Local Function • Written at the command prompt • Lasts for the current session alone • Global Function • Written in .bashrc file • Available as long as the definition is there in .bashrc file • Function in shell script • Available with in the file alone
  • 43. • Sample function Functionname() { echo $1 } Calling function: Functionname Ram Result: Ram
  • 44. • We can view the environment variables through set or env command • The set command will display all the global functions written by the user • The env command displays only the variables and not the functions • We can reassign values for the variables either temporarily or permanently • Temporary • Type varname=value at the command prompt • Permanent • Type varname=value in .bashrc at the root directory
  • 45. • Alias – Alternate name for an entity • Entity here refers to command • We can give another name or alias name for a command either at the command prompt or in the .bashrc file. • The former will be temporary and will vanish if the session ends and the latter will be permanent as long as the definition exists in the .bashrc file
  • 46. • alias newname=oldname • Eg alias co py= cp • Then we can use copy in the same way we use cp command • Eg co py file 1 file 2 //copies content of file1 to file2 • To remove alias use unalias command • unalias co py • After this we cannot use copy to perform copying function

Notas del editor

  1. $chmod u+x file.txt – Gives execution permission to the owner of the file Owner/user – Who creates a file Group – Collection of users Others – Apart from the user and the users in a group PermissionsValue Read4 Write2 Execute1 -rwxrwxrwx – All permissions given for a file drwxrwxrwx – All permissions given for a directory chmod 777 file //gives all permission (r,w,x) for a file UserGroupOther rwxrwxrwx 000000000----------chmod 000 file 111111111-rwxrwxrwxchmod 777 file Like this depending on set and reset of the bit flags, permission can be changed. DecOctal 0000 1001 2010 3011 4100 5101 6110 7111
  2. By default, terminal will be having scroll bar on the left side. There are many options to design terminal with our preference for colors and other things. See the man pages for more elaborate explanation.
  3. X – cuts the letter after cursor position x – cuts the letter before cursor position yy – Copies a line at which cursor is currently positioned yw – Copies a word at which cursor is currently positioned P – Pastes the copied content after cursor position p – Pastes the copied content before cursor position dd – Deletes a line
  4. grep abc hello.txt Finds the occurance of abc in hello.txt and displays the line in the screen grep –i abc hello.txt – Ignores case. Will find Abc, ABC, aBc, aBC etc grep –c abc hello.txt – Displays the count of matches grep –n abc hello.txt – Displays the matching lines along with line number grep –v abc hello.txt – Displays the lines that donot have the pattern abc ^a – Starts with a a$ - Ends with a a* - a followed by any number of characters a..b – a separated by 2 characters and then followed by b
  5. gcc filename.c This will create a default executable a.out gcc –o file filename.c This will create an executable by the name file and we can run the same
  6. Local functions #sayHello() &amp;gt;{ &amp;gt;echo “Hello” &amp;gt;} Now type function name #sayHello Hello//displays Hello at the command prompt # Global functions Open .bashrc file in the /root directory #vi .bashrc Type the function definition Save the file Close the terminal and re open it Type the function name. The function will be executed. We can use this function in any directory. Hence it is global.
  7. We can pass any number of parameters like this $0 – File name $1,$2… - first, second parameters and so on $? – stores the status (success or failure status of the last command that was executed) $# - stores the number of parameters passed through the command line #pwd /home #echo $? 0// As the last command is success #abc Error:command not found #echo $? 127 // as the last command didn’t execute successfully