AT & T
BSD
SCO
IBM
HP
DEC
Silicon Graphic
Sun used SVR4 and contributed NFS(Network file system) feature and
create sun solaris
Product is XENIX
XENIX sold off by Sana Cruz Operation and created most commercial
brand with different flavor SCO Unix, SCO open server release 5 and
SCO UnixWare 7
AIX
HP-UX
Digital Equipment Corporation created Digital Unix
IRIX
Novell
POSIX
MIT
AT & T sold off by novell and create standard for unix called X/OPEN
should be X/OPEN Compliant
Standard created by this name
Produce X Window a first GUI for UNIX
GNU
Linux
SUN
Microsoft
UNIX Features
Portable
Open System
Multi user system
Multi tasking system
Patter matching
Tool kit
Shell programming
Windowing system
Background processing
Redirection tool
Hierarchical file system
Shell is responsible for analyzing and interpreting the command. Kernal responsible
for command execution. Kernal is the heart of the system. It is the part of the unix
system that is loaded into memory when the system is booted. It manages the
system resources, allocate time between user and processes, decide process
priorities etc.
performs only the essential functions of an operating system. All other operating
system functions are performed by system processes.
Disadvantage of at command
There is no way you can find out the name of the program scheduled to be executed
The UNIX system is controlled by a number of shell variables that are separately set
by the system, some during the boot sequence and some after logging in. These
variables are called system variables.
HOME - when you log in, UNIX normally place you in a directory named after your
login name
IFS - word separator in command line can contain space, tab and newline
LOGNAME - shows your user name
MAIL - where all incoming mail addressed to the user is to be stored
PATH - instruct the shell about the route it should follow to locate any executable
command.
PS1 - set the primary prompt like $
PS2 - secondary prompt when multiline command make the shell respond like > in
case of echo
SHELL - determine the type of shell that a user sees on logging in. bash is standard
linux shell
TERM - terminal type being used.
Buffering vs Caching
In general, buffering is the process of holding data in a region of the memory until
the data is transported from one place to another. Buffering is used when moving
data between processes in the computer and in telecommunication. Typically,
buffering is required when there is difference between the speeds in which the data
Paging vs Swapping
Paging is a memory management method used by operating systems. Paging allows
the main memory to use data that is residing on a secondary storage device. These
data are stored in the secondary storage device as blocks of equal size called
pages. Paging allows the operating system to use data that will not fit in to the main
memory. Swapping is a term that is used to describe the act of moving all the
segments belonging to a process between the main memory and a secondary
storage device.
The basic concept of a shell script is a list of commands, which are listed in the
order of execution.
Shell scripts and functions are both interpreted.
Q: What is Daemon?
It is a process that runs in a background. The parent process of daemon is often init
process(PID=1). A process is usually become daemon by forking a child process and
then having their parent process immediately exit, thus causing init to adopt the
child process.
Q: Permission on files
Q: What is
internal and
external
command?
Program or file
having an
independent existence in the /bin directory is called external command like ls.
Some built-in command which dont found anywhere called internal command like
echo.
Systme call ?
a system call is how a program requests a service from an operating system's
kernel.
Generally, systems provide a library or API that sits between normal programs and
the operating system. On Unix-like systems, that API is usually part of an
implementation of the C library (libc), such as glibc, that provides wrapper functions
for the system calls, often named the same as the system calls that they call.
For example, in Unix-like systems, "fork" and "execve" are C library functions that in
turn execute instructions that invoke the "fork" and "execve" system calls. Making
the system call directly in the application code is more complicated and may require
embedded assembly code to be used (in C and C++) as well as knowledge of the
low-level binary interface for the system call operation, which may be subject to
change over time and thus not be part of the application binary interface; the
library functions are meant to abstract this away.
Profile
Classically, ~/.profile is used by Bourne Shell, and is probably supported by Bash
as a legacy measureand it is read by "login" shells
The ~/.bash_profile would be used once, at login.
The ~/.bashrc script is read every time a shell is started.
Therefore:
is the place to put stuff that applies to your whole session, such as programs
that you want to start when you log in (but not graphical programs, they go into a
different file), and environment variable definitions.
~/.profile
~/.bashrc
is the place to put stuff that applies only to bash itself, such as alias and
function definitions, shell options, and prompt settings. (You could also put key bindings
there, but for bash they normally go into ~/.inputrc.)
~/.bash_profile can be used instead of ~/.profile, but you also need to include
~/.bashrc if the shell is interactive.
Interestingly, it seems that many search engines want to provide my blog as a result when folks want to know
something about zombie processes, even though this site has nothing to do with them per se. As such, I will discourse
for a bit on the seemingly morbid topic of Zombie Processes, this sites namesake.
When a process finishes execution, it will have an exit status to report to its parent process. Because of this last little
bit of information, the process will remain in the operating systems process table as a zombie process, indicating that
it is not to be scheduled for further execution, but that it cannot be completely removed (and its process ID cannot be
reused) until it has been determined that the exit status is no longer needed.
When a child exits, the parent process will receive a SIGCHLD signal to indicate that one of its children has finished
executing; the parent process will typically call the wait()system call at this point. That call will provide the parent
with the childs exit status, and will cause the child to be reaped, or removed from the process table.
Buffering vs Caching
In general, buffering is the process of holding data in a region of the memory until the data is transported
from one place to another. Buffering is used when moving data between processes in the computer and in
telecommunication. Typically, buffering is required when there is difference between the speeds in which
the data is received and data is processed. Caching is the process of storing data in a separate place
(called the cache) such that they could be accessed faster if the same data is requested in the future.
When some data is requested, the cache is first checked to see whether it contains that data. If data is
already in the cache, the request can be satisfied faster.
What is Buffering?
Buffering is the process of holding data in a region of the memory until the data is transported from one
place to another. This region of memory that holds the data is called a buffer. Buffering is used when there
is a difference between the speed in which the data is received and the speed in which the data is
processed. Even though buffering can be implemented using hardware buffers or software buffers, most
widely used are the software buffers. Buffering is widely used in printer spooler, online video streaming
and telecommunication (when transferring data from one device to another). Most of the time, buffering is
done by writing data in to a queue in one speed and reading the data from the queue in another speed.
What is Caching?
Caching is the process of storing data in a separate place (called the cache) such that they could be
accessed faster if the same data is requested in the future. When some data is requested, the cache is
first checked to see whether it contains that data. If data is already in the cache, it is called a cache hit.
Then the data can be retrieved from the cache, which is much faster than retrieving it from the original
storage location. If the requested data is not in the cache, it is called a cache miss. Then the data needs
to be fetched from the original storage location, which would take a longer time. Caching is used in
different places. In the CPU, caching is used to improve the performance by reducing the time taken to
get data from the main memory. In web browsers, web caching is used to store responses from previous
visits to web sites, in order to make the next visits faster.
Whats the difference between Buffering and Caching?
Even though both caching and buffering involves storing data temporally in a different location, they have
some important differences. Caching is done to reduce the access time in retrieving data from a slower
storage device. It is based on the principle that the same data will be accessed multiple times thus storing
them in cache would reduce the access time largely. Buffering is mainly used to overcome the difference
between the speeds in which the data is received and data is processed by a device.
Paging vs Swapping
Paging is a memory management method used by operating systems. Paging allows the main memory to
use data that is residing on a secondary storage device. These data are stored in the secondary storage
device as blocks of equal size called pages. Paging allows the operating system to use data that will not
fit in to the main memory. Swapping is a term that is used to describe the act of moving all the segments
belonging to a process between the main memory and a secondary storage device.
What is Paging?
Paging is a memory management method used by operating systems. Paging allows the main memory to
use data that is residing on a secondary storage device. These data are stored in the secondary storage
device as blocks of same size called pages. Paging allows the operating system to use data that will not
fit in to the main memory. When a program tries to access a page, first the page table is checked to see
whether that page is on the main memory. Page table holds details about where the pages are stored. If it
is not in the main memory, it is called a page fault. Operating system is responsible for handling page
faults without showing it to the program. The operating system first finds where that particular page is
stored in the secondary storage and then brings it in to an empty page frame in the main memory. Then it
updates the page table to indicate that the new data is in the main memory and returns the control back to
the program that initially requested the page.
What is Swapping?
Swapping is the process of moving all the segments belonging to a process between the main memory
and a secondary storage device. Swapping occurs under heavier work loads. Operating system kernel
would move all the memory segments belonging to a process in to an area called swap area. When
selecting a process for swapping, the operating system will select a process that will not become active
for a while. When the main memory has enough space to hold the process, it will be transferred back in to
the main memory from the swap space so that its execution could be continued.
What is the difference between Paging and Swapping?
In paging, blocks of equal size (called pages) are transferred between the main memory and a secondary
storage device, while in swapping, all the segments belonging to a process will be moved back and forth
between the main memory and a secondary storage device. Since paging allows moving pages (it could
be a part of the address space of a process), it is more flexible than swapping. Since, paging only moves
pages (unlike swapping, which move a whole process), paging would allow more processes to reside on
the main memory at the same time, when compared with a swapping system. Swapping is more suitable
when running heavier workloads.
Brief about the initial process sequence while the system boots up?
While booting, special process called the 'swapper' or 'scheduler' is created with
Process- ID 0.
The swapper manages memory allocation for processes and influences CPU
allocation. The swapper inturn creates 3 children:
the process dispatcher,
vhand and
dbflush
with IDs 1,2 and 3 respectively.
This is done by executing the file "/etc/init". Process dispatcher gives birth to the
shell.
Unix keeps track of all the processes in an internal data structure called the Process
Table (listing command is ps -el).
What Happens when you execute a program?
When you execute a program on your UNIX system, the system creates a special
environment for that program.
This environment contains everything needed for the system to run the program as
if no other program were running on the system.
Each process has process context, which is everything that is unique about the state
of the program you are currently running.
Every time you execute a program the UNIX system does a fork, which performs a
series of operations to create a process context
and then execute your program in that context.
The steps include the following:
Allocate a slot in the process table, a list of currently running programs kept by
UNIX.
Assign a unique process identifier (PID) to the process.
iCopy the context of the parent, the process that requested the spawning of the new
process.
Return the new PID to the parent process. This enables the parent process to
examine or control the process directly.
After the fork is complete, UNIX runs your program.
What is piping?
It is a technique which gives the output of one command as an input of another