SlideShare una empresa de Scribd logo
1 de 7
UNIX OPERATING SYSTEM

        Unix operating systems are widely used in servers, workstations, and mobile devices. The
Unix environment and the client–server program model were essential elements in the
development of the Internet and the reshaping of computing as centered in networks rather than
in individual computers.
        Unix systems are characterized by various concepts: the use of plain text for storing data;
a hierarchical file system; treating devices and certain types of inter-process
communication (IPC) as files; and the use of a large number of software tools, small programs
that can be strung together through a command line interpreter using pipes, as opposed to using a
single monolithic program that includes all of the same functionality. These concepts are
collectively known as the Unix philosophy.
       The microkernel concept was introduced in an effort to reverse the trend towards larger
kernels and return to a system in which most tasks were completed by smaller utilities. In an era
when a "normal" computer consisted of a hard disk for storage and a data terminal for input and
output (I/O), the Unix file model worked quite well as most I/O was "linear". However, modern
systems include networking and other new devices. As graphical user interfaces developed, the
file model proved inadequate to the task of handling asynchronous events such as those
generated by a mouse, and in the 1980s non-blocking I/O and the set of inter-process
communication mechanisms was augmented (sockets, shared memory, queues, semaphores), and
functionalities such as network protocols were moved out of the kernel.
       A Unix kernel — the core or key components of the operating system — consists of
many kernel subsystems like process management, memory management, file management,
device management and network management.
Each of the subsystems has some features:

       Concurrency: As Unix is a multiprocessing OS, many processes run concurrently to
       improve the performance of the system.
       Virtual memory (VM): Memory management subsystem implements the virtual memory
       concept and a user need not worry about the executable program size and the RAM size.
       Paging: It is a technique to minimize the internal as well as the external fragmentation in
       the physical memory.
       Virtual file system (VFS): A VFS is a file system used to help the user to hide the
       different file systems complexities. A user can use the same standard file system related
       calls to access different file systems.
The kernel provides these and other basic services: interrupt and trap handling, separation
between user and system space, system calls, scheduling, timer and clock handling, file
descriptor management.
Unix Architecture:

Here is a basic block diagram of a UNIX system:




The main concept that unites all versions of UNIX is the following four basics:

       Kernel: The kernel is the heart of the operating system. It interacts with hardware and
       most of the tasks like memory management, tash scheduling and file management.
       Shell: The shell is the utility that processes your requests. When you type in a command
       at your terminal, the shell interprets the command and calls the program that you want.
       The shell uses standard syntax for all commands. C Shell, Bourne Shell and Korn Shell
       are most famous shells which are available with most of the Unix variants.
       Commands and Utilities: There are various command and utilities which you would use
       in your day to day activities. cp, mv, cat and grep etc. are few examples of commands
       and utilities. There are over 250 standard commands plus numerous others provided
       through 3rd party software. All the commands come along with various optional options.
       Files and Directories: All data in UNIX is organized into files. All files are organized into
       directories. These directories are organized into a tree-like structure called the filesystem.
System Bootup:

If you have a computer which has UNIX operating system installed on it, then you simply need
to turn on its power to make it live.

As soon as you turn on the power, system starts booting up and finally it prompts you to log into
the system, which is an activity to log into the system and use it for your day to day activities.

Login Unix:

When you first connect to a UNIX system, you usually see a prompt such as the following:

To log in:

   1. Have your userid (user identification) and password ready. Contact your system
      administrator if you don't have these yet.
   2. Type your userid at the login prompt, then press ENTER. Your userid is case-sensitive,
      so be sure you type it exactly as your system administrator instructed.
   3. Type your password at the password prompt, then press ENTER. Your password is also
      case-sensitive.
   4. If you provided correct userid and password then you would be allowed to enter into the
      system. Read the information and messages that come up on the screen something as
      below.

SHELL SCRIPT

       A shell script is a script written for the shell, or command line interpreter, of an operating
system. It is often considered a simple domain-specific programming language. Typical
operations performed by shell scripts include file manipulation, program execution, and printing
text

Programming

Many modern shells also supply various features usually found only in more sophisticated
general-purpose programming languages, such as control-flow constructs, variables, comments,
arrays, subroutines, and so on. With these sorts of features available, it is possible to write
reasonably sophisticated applications as shell scripts. However, they are still limited by the fact
that most shell languages have little or no support for data typing systems, classes, threading,
complex math, and other common full language features, and are also generally much slower
than compiled code or interpreted languages written with speed as a performance goal.
Advantages and disadvantages

Often, writing a shell script is much quicker than writing the equivalent code in other
programming languages. The many advantages include easy program or file selection, quick
start, and interactive debugging. A shell script can be used to provide a sequencing and decision-
making linkage around existing programs, and for moderately-sized scripts the absence of a
compilation step is an advantage. Interpretive running makes it easy to write debugging code into
a script and re-run it to detect and fix bugs. Non-expert users can use scripting to tailor the
behavior of programs, and shell scripting provides some limited scope for multiprocessing.

Command line arguments to scripts

When you start a script from your interactive login shell, you can provide arguments to that
script on the command line. These are automatically turned into variables that can be used inside
the script.

If the command line contains filename wildcard characters, variable substitution references, or
command substitution references, those are expanded or substituted first. Then the command line
string is broken into separate arguments at blanks, except that a quoted string can contain
embedded blanks.

You refer to these arguments as separate variables within the script itself by using the dollar sign
(variable substitution operator) followed by an integer number, for example,
    cp $1 $2

This statement inside a shell script would run the cp program with the first "argument" to the
shell script (first word on the command line that started the shell script) passed as the name of
the file to copy via $1, and the second argument to the shell script passed as the name of the new
copy via $2.

The entire list of command line arguments can be referenced as one string with the syntax
  $*

Making and setting your own variables in a script

In addition to the command line arguments, the shell maintains a table of other user-created or
special purpose variables in memory. Each variable has a name and a value.

     Names - up to 20 letters or digits (start with letter) - case matters!
     Values are strings of characters or digits of arbitrary length without any intrinsic "type".
     They are treated as character strings or numeric values, depending upon how they are
     used.

It is also possible to treat any variable as an array of words and access each word separately (see
detailed documentation on the C-shell).
Certain variable names are reserved by the shell for special uses, such as path or term.

You can create any number of variables.

Using variables in the script

"Variable substitution" is the process of replacing a reference to the name of a variable with its
actual value. This is how we use variables.

The dollar sign ($) is the basic substitution operator when it is used as the prefix for a variable
name. Anytime you use the dollar sign as the first letter of a word in a shell command, it will
expect the word to be the name of a variable. If you want the dollar sign to be interpreted as just
a simple dollar sign, precede it wth the backslash () "escape" character. Here are the basic
formats for variable substitution:

   $?name
This tests whether the name variable exists. If the variable does exist, the shell substitutes the
value 1 (one, true); if not, the value 0 (zero, false). Use this form if you are just using the variable
as a flag. The result can be used in an if statement to conditionally execute some commands.

   $name
This form causes the entire word list value of name to be substituted for the reference. If name is
not defined (was never set), you get an error.

   $#name
This substitutes the number of words contained within the name variable. If the variable has a
null value (that is, simply set as a "flag" variable), it substitutes zero. If the variable has never
been set, you get an error.

   $name[n]
This substitutes the "nth" word (blank separated value) from the name variable. The square
brackets are required to enclose the value n that specifies which word is wanted, and must follow
the variable name with no intervening spaces. This is a way to treat a variable containing a multi-
word value as an array of separate words. If you specify a word index value n that is greater than
the actual number of words in the variable, you get an error.

Examples:

   set a = ($b)
Sets new variable a equal to the word list in existing variable b.

  echo $b
Echoes (prints) the value of existing variable b to the standard output (terminal).

Flow-of-control statments
if and foreach are the basic flow-of-control statements. There are more advanced ones named
switch and while which are similar to the statements of the same name in the C language.

if

The if command allows you to conditionally execute a command or set of commands depending
upon whether some expression is true. There are two forms.

     if ( logical_expression ) command ...

     This form will execute command (which can have a long list of arguments) if the
     logical__expression is true. This expression can be one of the logical or file testing
     expressions described above. For example, you can test if a file whose name is stored in
     the shell's built-in variable $1 (first argument to the shell script) exists as a plain file, and
     if so, make a backup copy of it with:

       if ( -f $1 ) cp $1 $1.bak

     This simple cp command will not work if given a directory to copy, which is why there
     is the test for a "plain" file.

     if ( logical_expression ) then

       block of commands - any number of lines
       to be executed if logical_expression is "true"
       (or has non-zero value).

     else

       another block of commands - any number of lines
       to be executed if logical_expression is "false"
       (or has value 0).

     endif

     This form allows you to execute more than one command if the expression is true. The
     then keyword must follow the logical_expression test on the same line, and the endif
     keyword must be on a line by itself to end the entire if command. The else statement is
     optional. If you use this, the else keyword must be on a line by itself. The following
     lines up to the endif are executed if the expression was false. The "blocks of
     commands" may in turn contain additional nested if commands. Just be sure that each if
     has a matching endif statement enclosed in the same block.



Relational operators
-eq: equal to

-ne: not equal to

-ge: greater than or equal to

-le: less than or equal to

-gt: greater than

-lt: less than



Logical operators

!: not

-a: and

-o: or

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Operating systems system structures
Operating systems   system structuresOperating systems   system structures
Operating systems system structures
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Case study windows
Case study windowsCase study windows
Case study windows
 
Linux standard file system
Linux standard file systemLinux standard file system
Linux standard file system
 
UNIX Operating System
UNIX Operating SystemUNIX Operating System
UNIX Operating System
 
Chapter 2 - Operating System Structures
Chapter 2 - Operating System StructuresChapter 2 - Operating System Structures
Chapter 2 - Operating System Structures
 
Windows for Everyone(Operating System)
Windows for Everyone(Operating System)Windows for Everyone(Operating System)
Windows for Everyone(Operating System)
 
File system Os
File system OsFile system Os
File system Os
 
Linux file system
Linux file systemLinux file system
Linux file system
 
Unix - An Introduction
Unix - An IntroductionUnix - An Introduction
Unix - An Introduction
 
Unix ppt
Unix pptUnix ppt
Unix ppt
 
Case study operating systems
Case study operating systemsCase study operating systems
Case study operating systems
 
Unix
UnixUnix
Unix
 
Unix ppt
Unix pptUnix ppt
Unix ppt
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernel
 
Shell and its types in LINUX
Shell and its types in LINUXShell and its types in LINUX
Shell and its types in LINUX
 
11. dfs
11. dfs11. dfs
11. dfs
 
Distributed operating system
Distributed operating systemDistributed operating system
Distributed operating system
 
Unix Introduction
Unix IntroductionUnix Introduction
Unix Introduction
 
Internal representation of files ppt
Internal representation of files pptInternal representation of files ppt
Internal representation of files ppt
 

Destacado

Unix operating system
Unix operating systemUnix operating system
Unix operating systemABhay Panchal
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating Systemsubhsikha
 
Unix operating system basics
Unix operating system basicsUnix operating system basics
Unix operating system basicsSankar Suriya
 
Unix Internals OS Architecture
Unix Internals OS ArchitectureUnix Internals OS Architecture
Unix Internals OS ArchitectureKhader Shaik
 
Unix memory management
Unix memory managementUnix memory management
Unix memory managementTech_MX
 
Brainspotting presentation 2013_slideshare
Brainspotting presentation 2013_slideshareBrainspotting presentation 2013_slideshare
Brainspotting presentation 2013_slideshareBrainspotting
 
WELCOME TO THE CORE OF UNIX OPERATING SYSTEM
WELCOME TO THE CORE OF UNIX OPERATING SYSTEMWELCOME TO THE CORE OF UNIX OPERATING SYSTEM
WELCOME TO THE CORE OF UNIX OPERATING SYSTEMNarendra Mohan Mishra
 
unix interprocess communication
unix interprocess communicationunix interprocess communication
unix interprocess communicationguest4c9430
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating SystemMahakKasliwal
 
Estructura básica general del sistema unix
Estructura básica general del sistema unixEstructura básica general del sistema unix
Estructura básica general del sistema unixdrportugalb
 
Operating system; Multitasking
Operating system; MultitaskingOperating system; Multitasking
Operating system; MultitaskingFlameDimension95
 

Destacado (20)

Unix operating system
Unix operating systemUnix operating system
Unix operating system
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating System
 
Unix slideshare
Unix slideshareUnix slideshare
Unix slideshare
 
Unix
UnixUnix
Unix
 
Unix operating system basics
Unix operating system basicsUnix operating system basics
Unix operating system basics
 
Unix Internals OS Architecture
Unix Internals OS ArchitectureUnix Internals OS Architecture
Unix Internals OS Architecture
 
Basic Unix
Basic UnixBasic Unix
Basic Unix
 
IO Management
IO ManagementIO Management
IO Management
 
Introduction to unix
Introduction to unixIntroduction to unix
Introduction to unix
 
Unix memory management
Unix memory managementUnix memory management
Unix memory management
 
Introduction to unix
Introduction to unixIntroduction to unix
Introduction to unix
 
Unix ch03-03(2)
Unix ch03-03(2)Unix ch03-03(2)
Unix ch03-03(2)
 
Linux notes
Linux notesLinux notes
Linux notes
 
Brainspotting presentation 2013_slideshare
Brainspotting presentation 2013_slideshareBrainspotting presentation 2013_slideshare
Brainspotting presentation 2013_slideshare
 
WELCOME TO THE CORE OF UNIX OPERATING SYSTEM
WELCOME TO THE CORE OF UNIX OPERATING SYSTEMWELCOME TO THE CORE OF UNIX OPERATING SYSTEM
WELCOME TO THE CORE OF UNIX OPERATING SYSTEM
 
unix interprocess communication
unix interprocess communicationunix interprocess communication
unix interprocess communication
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating System
 
Estructura básica general del sistema unix
Estructura básica general del sistema unixEstructura básica general del sistema unix
Estructura básica general del sistema unix
 
Unix kernal
Unix kernalUnix kernal
Unix kernal
 
Operating system; Multitasking
Operating system; MultitaskingOperating system; Multitasking
Operating system; Multitasking
 

Similar a Unix operating system

84640411 study-of-unix-os
84640411 study-of-unix-os84640411 study-of-unix-os
84640411 study-of-unix-oshomeworkping3
 
M.c.a. (sem ii) operating systems
M.c.a. (sem   ii) operating systemsM.c.a. (sem   ii) operating systems
M.c.a. (sem ii) operating systemsTushar Rajput
 
Chapter 2 Introduction to Unix Concepts
Chapter 2 Introduction to Unix ConceptsChapter 2 Introduction to Unix Concepts
Chapter 2 Introduction to Unix ConceptsMeenalJabde
 
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya Jyothi
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya JyothiIntroduction to Unix operating system Chapter 1-PPT Mrs.Sowmya Jyothi
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya JyothiSowmya Jyothi
 
LinuxOS-1 (1).ppt
LinuxOS-1 (1).pptLinuxOS-1 (1).ppt
LinuxOS-1 (1).pptSavitha74
 
1_Introduction_To_Unix_and_Basic_Unix_Commands
1_Introduction_To_Unix_and_Basic_Unix_Commands1_Introduction_To_Unix_and_Basic_Unix_Commands
1_Introduction_To_Unix_and_Basic_Unix_CommandsGautam Raja
 
UNIT II-Programming in Linux
UNIT II-Programming in LinuxUNIT II-Programming in Linux
UNIT II-Programming in LinuxDr.YNM
 
Architecture-of-Linux-operating-system.docx
Architecture-of-Linux-operating-system.docxArchitecture-of-Linux-operating-system.docx
Architecture-of-Linux-operating-system.docxVivekGupta920049
 
Linux for beginners
Linux for beginnersLinux for beginners
Linux for beginnersNitesh Nayal
 
Linux principles and philosophy
Linux principles and philosophy Linux principles and philosophy
Linux principles and philosophy salamassh
 
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritpingchockit88
 
Unix_Introduction_BCA.pptx the very basi
Unix_Introduction_BCA.pptx the very basiUnix_Introduction_BCA.pptx the very basi
Unix_Introduction_BCA.pptx the very basiPriyadarshini648418
 

Similar a Unix operating system (20)

84640411 study-of-unix-os
84640411 study-of-unix-os84640411 study-of-unix-os
84640411 study-of-unix-os
 
M.c.a. (sem ii) operating systems
M.c.a. (sem   ii) operating systemsM.c.a. (sem   ii) operating systems
M.c.a. (sem ii) operating systems
 
Chapter 2 Introduction to Unix Concepts
Chapter 2 Introduction to Unix ConceptsChapter 2 Introduction to Unix Concepts
Chapter 2 Introduction to Unix Concepts
 
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya Jyothi
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya JyothiIntroduction to Unix operating system Chapter 1-PPT Mrs.Sowmya Jyothi
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya Jyothi
 
LinuxOS-1 (1).ppt
LinuxOS-1 (1).pptLinuxOS-1 (1).ppt
LinuxOS-1 (1).ppt
 
UNIX_Module 1.pdf
UNIX_Module 1.pdfUNIX_Module 1.pdf
UNIX_Module 1.pdf
 
1_Introduction_To_Unix_and_Basic_Unix_Commands
1_Introduction_To_Unix_and_Basic_Unix_Commands1_Introduction_To_Unix_and_Basic_Unix_Commands
1_Introduction_To_Unix_and_Basic_Unix_Commands
 
Spsl unit1
Spsl   unit1Spsl   unit1
Spsl unit1
 
UNIT II-Programming in Linux
UNIT II-Programming in LinuxUNIT II-Programming in Linux
UNIT II-Programming in Linux
 
Unix environment [autosaved]
Unix environment [autosaved]Unix environment [autosaved]
Unix environment [autosaved]
 
UNIX_module1.pptx
UNIX_module1.pptxUNIX_module1.pptx
UNIX_module1.pptx
 
Architecture-of-Linux-operating-system.docx
Architecture-of-Linux-operating-system.docxArchitecture-of-Linux-operating-system.docx
Architecture-of-Linux-operating-system.docx
 
Unix1
Unix1Unix1
Unix1
 
Linux for beginners
Linux for beginnersLinux for beginners
Linux for beginners
 
Linux
LinuxLinux
Linux
 
Linux principles and philosophy
Linux principles and philosophy Linux principles and philosophy
Linux principles and philosophy
 
Unix final
Unix finalUnix final
Unix final
 
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritping
 
Unix_Introduction_BCA.pptx the very basi
Unix_Introduction_BCA.pptx the very basiUnix_Introduction_BCA.pptx the very basi
Unix_Introduction_BCA.pptx the very basi
 
Unix lab manual
Unix lab manualUnix lab manual
Unix lab manual
 

Último

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 

Último (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

Unix operating system

  • 1. UNIX OPERATING SYSTEM Unix operating systems are widely used in servers, workstations, and mobile devices. The Unix environment and the client–server program model were essential elements in the development of the Internet and the reshaping of computing as centered in networks rather than in individual computers. Unix systems are characterized by various concepts: the use of plain text for storing data; a hierarchical file system; treating devices and certain types of inter-process communication (IPC) as files; and the use of a large number of software tools, small programs that can be strung together through a command line interpreter using pipes, as opposed to using a single monolithic program that includes all of the same functionality. These concepts are collectively known as the Unix philosophy. The microkernel concept was introduced in an effort to reverse the trend towards larger kernels and return to a system in which most tasks were completed by smaller utilities. In an era when a "normal" computer consisted of a hard disk for storage and a data terminal for input and output (I/O), the Unix file model worked quite well as most I/O was "linear". However, modern systems include networking and other new devices. As graphical user interfaces developed, the file model proved inadequate to the task of handling asynchronous events such as those generated by a mouse, and in the 1980s non-blocking I/O and the set of inter-process communication mechanisms was augmented (sockets, shared memory, queues, semaphores), and functionalities such as network protocols were moved out of the kernel. A Unix kernel — the core or key components of the operating system — consists of many kernel subsystems like process management, memory management, file management, device management and network management. Each of the subsystems has some features: Concurrency: As Unix is a multiprocessing OS, many processes run concurrently to improve the performance of the system. Virtual memory (VM): Memory management subsystem implements the virtual memory concept and a user need not worry about the executable program size and the RAM size. Paging: It is a technique to minimize the internal as well as the external fragmentation in the physical memory. Virtual file system (VFS): A VFS is a file system used to help the user to hide the different file systems complexities. A user can use the same standard file system related calls to access different file systems. The kernel provides these and other basic services: interrupt and trap handling, separation between user and system space, system calls, scheduling, timer and clock handling, file descriptor management.
  • 2. Unix Architecture: Here is a basic block diagram of a UNIX system: The main concept that unites all versions of UNIX is the following four basics: Kernel: The kernel is the heart of the operating system. It interacts with hardware and most of the tasks like memory management, tash scheduling and file management. Shell: The shell is the utility that processes your requests. When you type in a command at your terminal, the shell interprets the command and calls the program that you want. The shell uses standard syntax for all commands. C Shell, Bourne Shell and Korn Shell are most famous shells which are available with most of the Unix variants. Commands and Utilities: There are various command and utilities which you would use in your day to day activities. cp, mv, cat and grep etc. are few examples of commands and utilities. There are over 250 standard commands plus numerous others provided through 3rd party software. All the commands come along with various optional options. Files and Directories: All data in UNIX is organized into files. All files are organized into directories. These directories are organized into a tree-like structure called the filesystem.
  • 3. System Bootup: If you have a computer which has UNIX operating system installed on it, then you simply need to turn on its power to make it live. As soon as you turn on the power, system starts booting up and finally it prompts you to log into the system, which is an activity to log into the system and use it for your day to day activities. Login Unix: When you first connect to a UNIX system, you usually see a prompt such as the following: To log in: 1. Have your userid (user identification) and password ready. Contact your system administrator if you don't have these yet. 2. Type your userid at the login prompt, then press ENTER. Your userid is case-sensitive, so be sure you type it exactly as your system administrator instructed. 3. Type your password at the password prompt, then press ENTER. Your password is also case-sensitive. 4. If you provided correct userid and password then you would be allowed to enter into the system. Read the information and messages that come up on the screen something as below. SHELL SCRIPT A shell script is a script written for the shell, or command line interpreter, of an operating system. It is often considered a simple domain-specific programming language. Typical operations performed by shell scripts include file manipulation, program execution, and printing text Programming Many modern shells also supply various features usually found only in more sophisticated general-purpose programming languages, such as control-flow constructs, variables, comments, arrays, subroutines, and so on. With these sorts of features available, it is possible to write reasonably sophisticated applications as shell scripts. However, they are still limited by the fact that most shell languages have little or no support for data typing systems, classes, threading, complex math, and other common full language features, and are also generally much slower than compiled code or interpreted languages written with speed as a performance goal.
  • 4. Advantages and disadvantages Often, writing a shell script is much quicker than writing the equivalent code in other programming languages. The many advantages include easy program or file selection, quick start, and interactive debugging. A shell script can be used to provide a sequencing and decision- making linkage around existing programs, and for moderately-sized scripts the absence of a compilation step is an advantage. Interpretive running makes it easy to write debugging code into a script and re-run it to detect and fix bugs. Non-expert users can use scripting to tailor the behavior of programs, and shell scripting provides some limited scope for multiprocessing. Command line arguments to scripts When you start a script from your interactive login shell, you can provide arguments to that script on the command line. These are automatically turned into variables that can be used inside the script. If the command line contains filename wildcard characters, variable substitution references, or command substitution references, those are expanded or substituted first. Then the command line string is broken into separate arguments at blanks, except that a quoted string can contain embedded blanks. You refer to these arguments as separate variables within the script itself by using the dollar sign (variable substitution operator) followed by an integer number, for example, cp $1 $2 This statement inside a shell script would run the cp program with the first "argument" to the shell script (first word on the command line that started the shell script) passed as the name of the file to copy via $1, and the second argument to the shell script passed as the name of the new copy via $2. The entire list of command line arguments can be referenced as one string with the syntax $* Making and setting your own variables in a script In addition to the command line arguments, the shell maintains a table of other user-created or special purpose variables in memory. Each variable has a name and a value. Names - up to 20 letters or digits (start with letter) - case matters! Values are strings of characters or digits of arbitrary length without any intrinsic "type". They are treated as character strings or numeric values, depending upon how they are used. It is also possible to treat any variable as an array of words and access each word separately (see detailed documentation on the C-shell).
  • 5. Certain variable names are reserved by the shell for special uses, such as path or term. You can create any number of variables. Using variables in the script "Variable substitution" is the process of replacing a reference to the name of a variable with its actual value. This is how we use variables. The dollar sign ($) is the basic substitution operator when it is used as the prefix for a variable name. Anytime you use the dollar sign as the first letter of a word in a shell command, it will expect the word to be the name of a variable. If you want the dollar sign to be interpreted as just a simple dollar sign, precede it wth the backslash () "escape" character. Here are the basic formats for variable substitution: $?name This tests whether the name variable exists. If the variable does exist, the shell substitutes the value 1 (one, true); if not, the value 0 (zero, false). Use this form if you are just using the variable as a flag. The result can be used in an if statement to conditionally execute some commands. $name This form causes the entire word list value of name to be substituted for the reference. If name is not defined (was never set), you get an error. $#name This substitutes the number of words contained within the name variable. If the variable has a null value (that is, simply set as a "flag" variable), it substitutes zero. If the variable has never been set, you get an error. $name[n] This substitutes the "nth" word (blank separated value) from the name variable. The square brackets are required to enclose the value n that specifies which word is wanted, and must follow the variable name with no intervening spaces. This is a way to treat a variable containing a multi- word value as an array of separate words. If you specify a word index value n that is greater than the actual number of words in the variable, you get an error. Examples: set a = ($b) Sets new variable a equal to the word list in existing variable b. echo $b Echoes (prints) the value of existing variable b to the standard output (terminal). Flow-of-control statments
  • 6. if and foreach are the basic flow-of-control statements. There are more advanced ones named switch and while which are similar to the statements of the same name in the C language. if The if command allows you to conditionally execute a command or set of commands depending upon whether some expression is true. There are two forms. if ( logical_expression ) command ... This form will execute command (which can have a long list of arguments) if the logical__expression is true. This expression can be one of the logical or file testing expressions described above. For example, you can test if a file whose name is stored in the shell's built-in variable $1 (first argument to the shell script) exists as a plain file, and if so, make a backup copy of it with: if ( -f $1 ) cp $1 $1.bak This simple cp command will not work if given a directory to copy, which is why there is the test for a "plain" file. if ( logical_expression ) then block of commands - any number of lines to be executed if logical_expression is "true" (or has non-zero value). else another block of commands - any number of lines to be executed if logical_expression is "false" (or has value 0). endif This form allows you to execute more than one command if the expression is true. The then keyword must follow the logical_expression test on the same line, and the endif keyword must be on a line by itself to end the entire if command. The else statement is optional. If you use this, the else keyword must be on a line by itself. The following lines up to the endif are executed if the expression was false. The "blocks of commands" may in turn contain additional nested if commands. Just be sure that each if has a matching endif statement enclosed in the same block. Relational operators
  • 7. -eq: equal to -ne: not equal to -ge: greater than or equal to -le: less than or equal to -gt: greater than -lt: less than Logical operators !: not -a: and -o: or