UNIX OS

DAY – 1 Session - 1

9/14/2012 6:34:06 AM

Classification: GE Internal

Session 1

Objectives
Identify the functions of an OS Differentiate between single-user & multi-user OS What is UNIX ?

History of UNIX
Features of Unix

DOS & UNIX
Identify the inception, growth, features and architectures of Unix
9/14/2012 6:34:07 AM Classification: GE Internal Day 1/Session 1/Slide 2

Objectives (contd.)
Identify the various shell available in Unix Start a Unix session List the users who are currently logged in

Assign password to a Unix user using the passwd command
Ending a Unix Session: Logging out

Identify the features of Unix File System
List the contents of a directory using ls command
9/14/2012 6:34:07 AM Classification: GE Internal Day 1/Session 1/Slide 3

Objectives (contd.)
Create a directory using mkdir command Delete a directory using rmdir command Copy a file using the cp command

Move a file using the mv command
Delete a file using the rm command

Use the man command to get online help

9/14/2012 6:34:07 AM

Classification: GE Internal

Day 1/Session 1/Slide 4

etc. Unix. MSDOS. e.Getting Started  OS  An OS is a software program that acts an interface between a user & a computer.g. Linux.  Functions of an OS  Command Interpreter  Process Management  Memory Management  I/O Operation & Peripheral Management  File Management 9/14/2012 6:34:08 AM Classification: GE Internal Day 1/Session 1/Slide 5 .

9/14/2012 6:34:08 AM Classification: GE Internal Day 1/Session 1/Slide 6 .)  Types  of System Systems  Single-User A single-user system was designed for use by1 person at a time. A PC is a popular single-user system.  Single  User OS MS DOS is an example of a single-user OS.Getting Started (contd.

) Systems  Multi-User More than 1 user can work simultaneously on a multi-user system.Getting Started (contd.)  Types  of System (contd. 9/14/2012 6:34:08 AM Classification: GE Internal Day 1/Session 1/Slide 7 .

Getting Started (contd. 9/14/2012 6:34:08 AM Classification: GE Internal Day 1/Session 1/Slide 8 . Unix & Windows NT/2K/2K3 are examples of a multi-user systems  More than one user can connect to the system & work concurrently at any point of time.)  Types  of System(continued) Systems  Multi-User Linux.

Dennis Ritchie and Douglas McIlroy.What is UNIX ?  UNIX® (or Unix) is a portable. multi-task and multi-user computer operating system originally developed by a group of AT&T Bell Labs employees including Ken Thompson. 9/14/2012 6:34:08 AM Classification: GE Internal Day 1/Session 1/Slide 9 .

 Ken Thompson took person interest an developed UNICS and wrote it in assembly  UNICS was renamed to UNIX.  History Of Unix 9/14/2012 6:34:08 AM Classification: GE Internal Day 1/Session 1/Slide 10 . in the 60’s as on OS but was scrapped because of overheads. GE. AT&T Bell Labs.  Unix was re-written in 1973 in C Language for portability.History of UNIX  MULTICS was developed at MIT.

 Text processing is easy with Unix tools.  Multi 9/14/2012 6:34:08 AM Classification: GE Internal Day 1/Session 1/Slide 11 .tasking  Device Independent – All the resources are files.  Time Sharing  Multi .Feature of Unix – user OS.  Hierarchical File System.

ibm.com/servers/aix Apple University of California. Berkeley Sequent HP-UX Irix Hewlett-Packard Silicon Graphics SCO Solaris Unixware Ultrix 9/14/2012 6:34:08 AM Santa Cruz Operation owned by Novell Sun Microsystems Novell Digital Equipment Corp (DEC) Classification: GE Internal Day 1/Session 1/Slide 12 .UNIX OS Flavors Unix Product Company/Organization AIX A/UX BSD-lite & BSD Dynix IBM www-1.

com www.slackware.com www.redhat.com Classification: GE Internal Day 1/Session 1/Slide 13 .caldera.linux-mandrake.com Debian Suse Slackware 9/14/2012 6:34:08 AM www.com www.org www.suse.debian.Linux OS Flavors Distributors Name Website Red Hat Caldera Mandrake www.

hence are free.command.DOS & UNIX DOS UNIX Multi-User Multi Tasking Time Sharing Single User Single Tasking Not a Time Sharing OS CLI Shell . Classification: GE Internal Day 1/Session 1/Slide 14 .com Kernel – msdos.sys FAT Max Partition Size 2 GB Cost is very less 9/14/2012 6:34:08 AM CLI & GUI Various types of shell Kernel differs from flavor to flavor Hierarchal Max Partition Size 16 TB (may change depending on flavours) High cost but unix like os are under GNU.

The Unix Architecture  The Unix OS system consists of the following: Kernel  Shell  Utilities & Application Programs 9/14/2012 6:34:08 AM Classification: GE Internal Day 1/Session 1/Slide 15 .

Shell Available in Unix  Bourne Shell (path:/bin/sh)  Bourne Again Shell (path:/bin/sh)  C Shell (path:/bin/csh)  Korn Shell (path:/bin/csh)  Restricted Shell (path:/bin/rsh)  Tcsh Shell (path:/bin/tcsh)  A Shell (path:/bin/ash)  Z Shell(path:/bin/rsh) 9/14/2012 6:34:08 AM Classification: GE Internal Day 1/Session 1/Slide 16 .

The user prompt for Bourne Shell is ‘$’. The user prompt for Korn Shell is ‘$’. The booting & SU shell for Unix like OS is Bourne Again Shell. Korn Shell developed by David Korn is a combination of Bourn & C Shell. Classification: GE Internal Day 1/Session 1/Slide 17 9/14/2012 6:34:08 AM .Shell          The program that reads and interprets the command execute by the user is known as the shell. The user prompt for C Shell is ‘%’. The booting & SU shell is Bourne Shell developed by Stephen Bourne for Unix OS. The prompt for SU is ‘#’. The C shell is developed by Bill Joe and is ‘C’ like.

telnet hostname or IP Address  The administrator assigns each user a HOME directory when a new logon account is created. 9/14/2012 6:34:08 AM Classification: GE Internal Day 1/Session 1/Slide 18 .Starting a Unix Session: Log On  Connect to a computer running the Unix OS from any other computer using telnet program.

Users Current Logged In A list of users who are currently logged in can be found by using the who command who [options] 9/14/2012 6:34:08 AM Classification: GE Internal Day 1/Session 1/Slide 19 .

9/14/2012 6:34:08 AM Classification: GE Internal Day 1/Session 1/Slide 20 .Passwords Security for the Users: Passwords  Unix provides an additional measure of security by allowing you to have a password associated with your login name  The combination of the login name & password is checked by Unix to verify if it is an authorized user Changing the User Password  Passwords can be changed using the passwd command  The passwd command prompts for the old password to ensure that only authorizes user is trying to change it.

9/14/2012 6:34:08 AM Classification: GE Internal Day 1/Session 1/Slide 21 .Root user  The root user (also know as the super user) is the administrator of the Unix OS.

Ending a Unix Session: Log out  Typing exit or logout or <Ctrl + D> at the command prompt ends current Unix session 9/14/2012 6:34:08 AM Classification: GE Internal Day 1/Session 1/Slide 22 .

The Unix File System 9/14/2012 6:34:08 AM Classification: GE Internal Day 1/Session 1/Slide 23 .

The Linux File System 9/14/2012 6:34:09 AM Classification: GE Internal Day 1/Session 1/Slide 24 .

The Unix File System (Contd.  The /usr or /home (Linux) directory contains all the HOME directories of all the users in the system 9/14/2012 6:34:09 AM Classification: GE Internal Day 1/Session 1/Slide 25 . such as the passwd file.)  The /bin directory stores many utilities of Unix  The /dev directory stores all the device-related files for the system  The /etc stores OS related data which the user & the OS needs to refer to.

)  The /usr directory stores in Linux OS stores the OS files that are not part of the booting process  The /var directory has the information specific to different utilities  The /mnt directory stores the mountable devices 9/14/2012 6:34:09 AM Classification: GE Internal Day 1/Session 1/Slide 26 .The Unix File System (Contd.

except ‘/’  Can contain both uppercase & lower case letters.Unix File Names  Can be up to 256 character long  Can contain special characters.  Files are case sensitive  Should not contain blank or tab 9/14/2012 6:34:09 AM Classification: GE Internal Day 1/Session 1/Slide 27 .

Types of Files in Unix File Types Ordinary Files Special Files Direcory Files Block Device File 9/14/2012 6:34:09 AM Character Device File Hard Link Symbolic Link Day 1/Session 1/Slide 28 Classification: GE Internal .

The user who creates the file is said to be the owner. A group of users is also given a name. just as the user These are those users who do not belong to a particular group    File Owner  Group Owner  Other Users  9/14/2012 6:34:09 AM Classification: GE Internal Day 1/Session 1/Slide 29 .Types of users in Unix  System Administrator/Super User  A System Administrator (SA/su) is primarily responsible for the smooth operation of the Unix OS.

Directory commands in Unix  Identifying the Current Directory Path  The pwd (print working directory) command is used to display full path name of the current directory  Listing the contents of the directory  The ls command is used to display the names of the files and sub-directories in a directory The cd (change directory) command changes to the directory specified Changing the Current Directory  9/14/2012 6:34:09 AM Classification: GE Internal Day 1/Session 1/Slide 30 .

Directory commands in Unix  Creating  The a Directory mkdir (make directory) command is used to create directories. rmdir (remove directory) command removes the specified directory Removing a Directory  The 9/14/2012 6:34:09 AM Classification: GE Internal Day 1/Session 1/Slide 31 .

File commands in Unix  The cat (concatenate) command displays the contains of the specified file  Copying the files  The cp (copy)command duplicates the contents of the source file in the target file cp options source file target file  Removing the files  The rm (remove) command is used to delete the files or directories rm options file/s 9/14/2012 6:34:09 AM Classification: GE Internal Day 1/Session 1/Slide 32 .

File commands in Unix  Moving and Renaming the files  The mv (move) command is used to move a file or a directory from one location to another or to change its name mv option source destination The more command is used to display the data one screen-full at a time. more options filename  Displaying the contents Page-Wise  9/14/2012 6:34:09 AM Classification: GE Internal Day 1/Session 1/Slide 33 . While viewing a file using more command. once the user scrolls down. he can’t move up.

File commands in Unix  Displaying  The the contents Page-Wise(contd. less options filename 9/14/2012 6:34:09 AM Classification: GE Internal Day 1/Session 1/Slide 34 .) less command is similar to more command except that the user can scroll upwards also while viewing the file.

one or more characters  The ? wild card matches exactly one or more occurrence of any character  The [ ] wild card can be used to restrict the characters to be matched 9/14/2012 6:34:09 AM Classification: GE Internal Day 1/Session 1/Slide 35 .Wild Characters  The shell offers the facility to perform an operation on a set of files by the use of certain special characters in the command in place of the actual filenames  The * wild card is interpreted as a string of none.

Get Online Help  The man command is used to get online help to a user about the various options for any command in Unix. man command 9/14/2012 6:34:10 AM Classification: GE Internal Day 1/Session 1/Slide 36 .

Miscellaneous Commands Command bc cal clear date echo Description Basic Calculator Calendar To clear the screen To display system date & time To display a string tty type uname Terminal type To display whether the command is built-in or not Name of the System unit wc who who am i To find units The count of lines. words & characters in the file To display the number of user logged in to the OS If the user wants to know who is he logged in as 9/14/2012 6:34:10 AM Classification: GE Internal Day 1/Session 1/Slide 37 .

Summary In this Session :  An a OS has the following functions:      Command Interpreter Process Management Memory Management I/O Operation& Peripheral Management File Management  A single-user is designed to be used by one person at a time  More than one user can work simultaneously on a multi-user system 9/14/2012 6:34:10 AM Classification: GE Internal Day 1/Session 1/Slide 38 .

)  What is UNIX?  History of UNIX?  Feature of UNIX  Unix Flavors  Linux Flavors  DOS & UNIX 9/14/2012 6:34:10 AM Classification: GE Internal Day 1/Session 1/Slide 39 .Summary(contd.

Summary(contd.)  The Unix OS consist of the kernel. utilities and application programs  Some of the commonly available shells are:        Bourne Shell C Shell Korn Shell Restricted Shell Bash Shell Tcsh Shell A Shell Z Shell Classification: GE Internal Day 1/Session 1/Slide 40 9/14/2012 6:34:10 AM . shell.

Summary(contd. Unix provides a file system which allows the user to group files in a convenient manner. The Unix file system has a hierarchal structure & files can be stored under directories 9/14/2012 6:34:10 AM Classification: GE Internal Day 1/Session 1/Slide 41 .  For organizing the data on the disk.)  The telnet command is used to connect to a Unix server  The passwd command is used to change the password of the user.

Summary(contd.)  There are 3 categories of files :   Ordinary files Directory files Special files System Administrator (SA/su) File Owner Group Owner Other user  The types of user are :    9/14/2012 6:34:10 AM Classification: GE Internal Day 1/Session 1/Slide 42 .

Summary(contd.)  Some      of the common directory commands:- pwd cd mkdir rmdir ls 9/14/2012 6:34:10 AM Classification: GE Internal Day 1/Session 1/Slide 43 .

)  Some       of the common file commands:- cat cp mv rm more less 9/14/2012 6:34:10 AM Classification: GE Internal Day 1/Session 1/Slide 44 .Summary(contd.

Summary(contd.)  The shell offers a facility to perform an operation on a set of files by using the wild card pattern. The most common wild cards:    ? – Matches one character in a file name * – Matches zero. one or more than one character in a file name [ ] – Matches one character from the enclosed list  The man command is used to get online help to a user about various options for any command.  Miscellaneous Commands 9/14/2012 6:34:10 AM Classification: GE Internal Day 1/Session 1/Slide 45 .

Recall  RECALL 9/14/2012 6:34:10 AM Classification: GE Internal Day 1/Session 1/Slide 46 .

Assignments  Assignment 9/14/2012 6:34:10 AM Classification: GE Internal Day 1/Session 1/Slide 47 .

END of SESSION -1 9/14/2012 6:34:07 AM Classification: GE Internal Session 1 .