Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

23A-PERL AND PYTHON PROGRAMMING

FOR BIOINFORMATICS

UNIT 1- UNIX

SUBMITTED TO, SUBMITTED BY,


DR.N.JEYAKUMAR KAVYA K
PROFESSOR 23BIIA06
I M.Sc Bioinformatics
Content:
• Overview
• Unix-Filesystem
• Text processing
• Comands and operations
• Unix filenames &file protections
• Working with directories
UNIX
• UNIX is a multitasking, multiuser, time saving
operating system(OS).
• The fullform of UNIX (UNIC)-Uniplexed
Information Computing System.
• Unix was initially developed as an assembly
language but was soon rewritten in C
programming language.
HISTORY OF UNIX

YEAR EVOLUTION OF UNIX


1960 Bell labs involved in the project with MIT,
General Electric and Bell Laboratories to
develop a time sharing system called
MULTICS(Multiplexed Operating and
Computing System).

1969 Ken Thompson wrote the first version of


the UNIX called UNICS(Uniplexed
Information and Computing System)

1970 Finally UNICS became UNIX.


UNIX uses: –
▪ GRAPICAL USER INTERFACE
▪ COMMAND LINE INTERFACE
UNIX System Structure
• The Architecture of the UNIX system is divided
into 4 major components. They are:
• 1) The Kernel
• 2) The Shell
• 3) Files and Processes
• 4) System Calls
ARCHITECTURE OF UNIX
1. The Kernel
➢ The Kernel is the heart of the Operating
System.
➢Interface between Shell and Hardware.
➢Performs Low Level Task.
➢ Eg: Device Management, Memory
Management
2. The Shell
➢The Shell is a collection of UNIX Commands.
➢ Acts as an interface between the user and the
kernel.
➢Command Line Interpreter(CLI)–Translates the
commands provided by the user and converts
it into a language that is understood by the
Kernel.
➢Eg: C Shell, Bourne Shell, Korn Shell etc
3. Files and Processes
➢ A File is an array of bytes and can contain
anything.
➢All the data in UNIX is organized into files.
➢ A Process is a program file under execution.
➢Files and Processes belongs to a separate
hierarchical structure.
4. System Calls
➢ UNIX is written in C.
➢ Thousands of commands in the system uses a
handful of functions called System Calls to
communicate with the kernel.
FEATURES OF UNIX
• Open Source
• Multitasking
• Multi-user
• Simple design, organization and functioning
• Portability
• File Security and Protection
• Command Structure
• Communication
• Hierarchical file system
UNIX FILE SYSTEM
• Unix File System is defined as the framework
that organizes and stores a large amount of
data that can be handled easily.
• Unix file system has several important
features. 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 file system.
• The entire file system follows a hierarchy in
which directories act as a special file
containing multiple files.
• The highest level directories is known as the
root(/)
• Unix file system also uses a set of permissions
to control access to files and directories. Each
file and directory has an owner and a group
associated with it, and permissions can be set
to allow or restrict access to these entities.
UNIX FILENAMES
• Unix filenames contain only letters, numbers,
and the underscore,dot and dash characters,
no spaces.
• Filename limited to 255 characters
• bin - short for binaries, this is the directory where many commonly used
executable commands reside
• dev - contains device specific files
• etc - contains system configuration files
• home - contains user directories and files
• lib - contains all library files
• mnt - contains device files related to mounted devices
• proc - contains files related to system processes
• root - the root users' home directory (note this is different than /)
• sbin - system binary files reside here. If there is no sbin directory on your
system, these files most likely reside in etc
• tmp - storage for temporary files which are periodically removed from the
filesystem
• usr - also contains executable commands
• The UNIX file system are classified into six types.
1.Ordinary files- includes texts and data,stores
information of the user,always placed under the
directory file.
2.Directories-stores both special and ordinary files,used
to organise collection of files
3.Special files-represent physical devices like printers,tape
drivers
4.Pipes-used to link commands together,provide the one
way flow of data
5.Sockets-enables advanced inter process communication
6.Symbolic links-used to reference another file in the
system
TEXT PROCESSING

• Unix provides a number of powerful


commands to process texts in different ways.
These text processing commands are often
implemented as filters.
• Filters are commands that always read their
input from ‘stdin’ and write their output to
‘stdout’. Users can use file redirection and
‘pipes’ to setup ‘stdin’ and ‘stdout’ as per their
need
COMMANDS FOR TEXT PROCESSING
grep -grep [options] pattern [files].
we- we [options] filenames
more- more [options] [files]
paste-paste <file1> <file2>
Commands & Operations
COMMAND ACTION
cat Print contents of file in the command
window
man view manual pages for unix commands
cp Copy the contents of file into file2
history List history of all commands issued at
system prompt
clear Clear screen
date show current date and time
FILE PROTECTION AND PERMISSIONS
• Unix allows three forms of access to any file
1. Read,
2. Write, and
3. Execute.
• To read-(r)
• To write-(w)
• To execute-(x)
WORKING WITH DIRECTORIES

• Viewing our current directory-pwd


• Creating directories-mkdir
• Deleting directories-rmdir
• Chanding directories-cd
• Listing contents of the current directory-ls
• Viewing directory sizes –du with sh(du-sh)
REFERENCE:
1. https://help.dreamhost.com/hc/en-
us/articles/215465297-UNIX-commands-
Working-with-directories
2.www.tutorialspoint.com
THANK YOU

You might also like