Operating System
Operating System
CERTIFICATE
This is to certify that Roshan Jha pursuing BBA(CAM) from IIMT has completed this practical file under my supervision and guidance. He has taken care of all the instructions and shown interest and sincerity during the completion of this computer practical file is up to my expectation as per the quality laid down by Guru Gobind Singh Indraprastha University, Dwarka ,Delhi.
ACKNOWLEDGEMENT
An undertaking such as this is never the work of single person is no exception. I, at the very outset, thank and express my gratitude to all those who directly or indirectly helped me a lot in completion of the present practical work and encouraged, inspire and enthusiasts me in the moment of despair and made it possible for this report to be in your hand today.
First of all, I wish to express my profound feeling of gratitude and indebt to my project guide Mrs. Seema Nath Jain,(H.O.D)BBA. IIMT (Delhi) for her advice and guidance during various stages of this practical. In spite of her preoccupation and job responsibilities she has spared her time during the completion of this work. I thank her whole heartedly.
I wish to record my sincere gratitude to Mrs. Seema Nath Jain, HOD(BBA), who provided constant support to me during my work.
UNIX
UNIX OS had a very humble beginning AT&T Bell Lab. The aim was to develop an OS that could serve a large community of users and allow them to share data if need be. This enterprise was called Multics for multiplex information and computing service. This system was named UNIX by Brian Kernighan as a very reminder of ifflated Multics. All the assembly code of unix was machine dependent and was not portable. To remedy this KEN THOMSON created a new language B and said on the task of re-writing the whole unix in this high level language. Dennis Ritchie shifted the inadequacies of B nd modified it to a new language which he named as C. The whole code of unix is written in C.
2) MULTITASKING -: Unix is multitasking implying that it is capable of carrying out more than one job at the same time. This is managed by dividing the time interval intelligently between all processes being carried out. Depending upon the priority of the task OS appropriately allots small time slots to each foreground & background tasks. Programs which are more important are given high priority, programmes which have same priority are scheduled on round robbin basis.
3) COMMUNICATION -: Unix has excellent provision for communicating with fellow users. The communication may be within the network of a single main computer or between 2 or more such computer network. Users can easily exchange mail, data, programs through such network. Distance poses no barriers.
4) SECURITY -: Unix has 3 provisions for protecting data. The first is provided by assigning passwords & login names to individuals users. At the file level there are read, write and execute permissions to each file which decide who can access a particular file, who can modify it and who can execute it. Lastly there is a file inscription code. This utility incods your into an unreadable format so that even if someone succeeds in opening it he can not see.
5) PORTABILITY -: One of the major reasons for universal popularity of unix is that it it can be ported to almost any computer system with only the bear minimum of adaptations to suit the given computer architecture. Unix is almost entirely written in C.
The functioning of Unix is divided into 3 levels. On the outer crust reside the application program & other utility. At the heart of UNIX is the Kernel which interacts with the actual hardware in machine language. The stream linning of these two modes of communication is done by middle layer called shell. Shell interpret the command that we give & conveys them to the kernel which ultimately executes them. Shell is also known as command interprator. Kernel has various functions it manages file, memory, transfer of data between file system & hardware. It also handles any interrupts issued. The kernel program is usually stored in file called sh. Thus at a particular movement of timer there may be several shells running in memory but only 1 kernel.
TYPES OF SHELL
1. BOURNE SHELL - This is STEVE BOURNEs creation and
is the most popular. The prompt sign is $ form for Bourne shell.
over Boune shell. First it allows aliasing of commands instead of typing The entire command we can use short alias at the command line. C Shell has a command history features. Previously typed commands can be recalled. Prompt sign is %.
3. KORN SHELL It is not so widely used. It is very powerful
& a Superset of Bourne shell. It offers a lot more capabilities & is more efficient than the others. Designed by DAVID KORN of AT&T Bell Lab.
ASSIGNMENT -1
For Working in UNIX OPERATING SYSYTEM Go to start option in task bar. Click on run option Then type Tel Net 192.168.0.3 Enter your login i.e iimt01 Enter the password i.e. iimt001 START RUN TELNET 192.168.0.3
10
1. $ echo hello world <enter> echo command will used to display on screen. It will display hello world on screen.
11
12
3. DATE This command will display the current date and along with time
4. $ who <enter> This command displays data about the entire user who have logged into the system currently. In this the first entity is the users login name followed by the terminal line and the login date and time.
13
5. $ ls l <enter> This command gives detail of all the files and directories. This command will used to see the login list view of all the files and directories present.
$ ls [option] Options used with ls: a. ls x<enter> it is used for multicolumn output.
b. ls a <enter> this will show all hidden files beginning with . Includind all files.
15
16
This command will display the calendar of April 2007 cal command can be used with several options. If only cal is written it will display the calendar
7. $ who am I <enter> This command shows that who is logged on to the system. This command is the special case of the who command. Here user1 is the users login name, pts/1 signifies the terminal number or serial port line by which the users terminal is connected to host machine.
17
8.) $ finger <enter> This command displays all the users list who have logged on to system . this command is similar to who command, but this command also display the heading of entities like first entity is for login followed by name and so on.
18
9. $ pwd <enter> This command displays the path in which we are presently working. pwd stands for present working directory
19
11. $ ls <enter> This command displays the listing of contents of file and directories. It only print the name of files and directories without giving its detail
12.) $ mkdir dirname <enter> This commands is used to create a new directory Syntax:Mkdir [directory name] <enter> Mkdir operating <enter> It will make directory named operating. Among the option available with mkdir is p which allows to create multiple generation of directories. Syntax:Mkdir p mohit1/geetika2/ridhima3/poonam4/babita5 This p option tells unix to create mohit1 , geetika2 , ridhima3 , poonam4 , babita5..
20
21
13. cd dirname <enter> This command is used to go inside the created directory. cd stands for change directory. Syntax : Cd kernel <enter> This command will take you inside the directory named kernel
14 $ cat > os01 <enter> This command is used to create a file . (b).) $ cat os01 <enter> This command is used to display the contents of file.
22
(c). $ cat file os01 os02 > os03 <enter> This will join (combine) the contents of file os01 and os02 , in new file os03.
23
24
16)$ who <enter> This command is also used for manual listing. It will display the use of who command the description of several option that can used with their command.
17) $ cd<enter> Come out from present working directory, first the user will come out from the last entered directory
25
18) $ cal 2012<enter> This will display the whole calendar of year of 2012
19) $ cal 9 1792<enter> This command wil display calendar of September 1752 Note-here the number from 3 to 13 are missing.
26
20) $ echo 5+4 | bc This command is used for calculation. Here echo command is used for displaying | is piping symbol bc stands for binary calculation
21)$ cat filename <enter> It is used to view the contents of a file. Eg: cat os01 It will display the contents of file os01
27
Assignment 2
1. Make directories called Vodafone and create sub directories schemes and recharges. $ mkdir Vodafone vodafone is created
VODAFONE
SCHEMES
RECHARGES
28
2. delete the sub directory called Vodafone? $ rmdir Vodafone Rmdir command is used to delete the directory. For this there shouldnt be any file inside the directory.
3. copy the file /etc/passwd into your home directory? cp command is used to copy the contents of one file into another file. Syntax:- $ cp <source name> <target name>
29
4. move the file into the sub directory. mv command is used to move a file. Syntax:- $ mv <source name> <target name>
Now the total contents of file one are removed with another.
30
5. how would you create and then delete a file called friend? Creating file:- cat command is used to create a file. Syntax:- $ cat>filename Ex.:- $ cat>friend To save file: ctrl+z Deleting file:- rm command is used to remove a file. Syntax:- $ rm friend
31
Assignment -3
1. Program to find whether the number is even or odd.
32
33
3. In a company an employ is paid as under If the basic salary is less then rs. 8000then hra = 15% of the basic salary and da =45% of the basic. If the salary is either equal to or above 8000, then hra = rs 500 and da = 55% of basic salary. If the employ salary is input through the key board , write a programto find his gross salary.
34
4. Write a menu driven program which has the following options. 1. contents of \etc\passwd 2. list of users who currently logged in. 3. present working directory 4. exit make the case statement , the menu should be placed approximately in the center of the screen and should be displayed in bold using the tput statement.
35
36
37
38
Output
39
Output
40
41
Output
42
Output
43
Output
44