Operating System
Operating System
Operating System
Unit-1
Evolution of OS
1
Swati Jain, Assistant
Professor, VIPS
What is an Operating System?
Ø Resourceallocator -
manages and allocates resources
ØControl program -
Øcontrols the execution of user programs and
operations of I/O devices
ØKernel -
the one program running at all times (all else being
application programs)
It’s an
Operating
System
Linux is a Unix clone written from scratch by
Linus Torvalds with assistance from a
loosely-knit team of hackers across the Net.
Unix is a multitasking, multi-user computer
operating system originally developed in
1969 by a group of AT&T employees at Bell
Labs.
Linux and Unix strive to be POSIX compliant.
64% of the world’s servers run some variant
of Unix or Linux. The Android phone and the
Kindle run Linux.
The Linux directory structure is like a tree. The base of the Linux file system hierarchy
begins at the root. Directories branch off the root, but everything starts at root.
The directory separator in Linux is the forward slash (/). When talking about
directories and speaking directory paths, “forward slash” is abbreviated to “slash.”
Often the root of the file system is referred to as “slash” since the full path to it is /. If
you hear someone say “look in slash” or “that file is in slash,” they are referring to the
root directory.
The /bin directory is where you will find binary or executable files. Programs are
written in source code which is human readable text. Source code is then compiled
into machine readable binaries. They are called binaries because machine code is a
series of zeros and ones. The import thing to know is that commands, programs, and
applications that you can use are sometimes located in /bin.
Configuration files live in the /etc directory. Configuration files control how the
operating system or applications behave. For example, there is a file in /etc that tells
the operating system whether to boot into a text mode or a graphical mode.
User home directories are located in /home. If your account name is “pat” your home
directory will be /home/pat. Linux systems can and often do have multiple user accounts.
Home directories allow each user to separate their data from the other users on the system.
The pat directory is knows as a subdirectory. A subdirectory is simply a directory that
resides inside another directory.
The /opt directory houses optional or third party software. Software that is not bundled
with the operating system will often been installed in /opt. For example, the Google Earth
application is not part of the standard Linux operating system and gets installed in the
/opt/google/earth directory.
Temporary space is allocated in /tmp. Most Linux distributions clear the contents of /tmp at
boot time. Be aware that if you put files in /tmp and the Linux system reboots, your files
will more than likely be gone. The /tmp directory is a great place to store temporary files,
but do not put anything in /tmp that you want to keep long term.
The /usr directory is called “user.” You will find user related binary programs and
executables in the /usr/bin directory.
Variable data such as log files reside in /var. Specifically, the /var/log directory contains
logs generated by the operating system and other applications.
Linux commands are an essential part of managing and operating Linux
systems, providing users with the ability to perform a wide range of
tasks from file manipulation to system monitoring.
These commands can be categorized into two types: internal and
external commands.
Internal commands are built into the shell itself, enabling quick
execution without the need for external binaries.
In contrast, external commands are separate executable files located in
the system’s file hierarchy.
To determine whether a command is internal or external, you can use
the type command. The type command provides information about how
a command name is interpreted. Here is how you can use it:
type command_name
For example:
$ type cd
This will output: cd is a shell builtin. Indicating that cd is an internal
command.
$ type ls
This will output: ls is hashed (/usr/bin/ls). Indicating that ls is an
external command located in the /bin directory.
The “man” command, short for manual, is a powerful tool in the Linux operating system
that allows users to access detailed information about various commands, utilities, and
system calls.
The “man” command provides comprehensive documentation, helping users understand
how to use and configure different elements of the Linux environment.
When you type man followed by a command name, it retrieves and displays the manual
page for that command, offering comprehensive details on how to use it, including all
available options and flags. This command is crucial for learning about the tools and
commands available in the Linux operating system.
For example: To view the manual for the “ls” command execute the following command:man ls
•This will display detailed information about the “ls” command, including its usage, options, and
examples.
Some commands don't have man pages or have incomplete man pages and
store their information as document form. To view these pages info command
is used.
Info pages are made with texinfo tools, can link with other pages and create
menus.
Directory Commands
Basic Linux Commands for Directories and Files
File Commands
Basic Linux Commands for Directories and Files
Other Commands
The default editor that comes with the
Linux/UNIX operating system is called vi
(visual editor).
Using vi editor, we can edit an existing file or
create a new file from scratch. we can also use
this editor to just read a text file.
The advanced version of the vi editor is the
vim editor.
There are three modes of operation in vi:
• Shell is a command-line interpreter that allows the user to
interact with the system.
• The file needs to begin with the shebang line (#!) to let the Linux
system know which interpreter to use for the shell script.
#!/bin/bash
#!/bin/sh