Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
4Activity
0 of .
Results for:
No results containing your search query
P. 1
Why is UNIX More Portable Than Other Operating System

Why is UNIX More Portable Than Other Operating System

Ratings: (0)|Views: 325 |Likes:
Published by Mukesh Kumar

More info:

Published by: Mukesh Kumar on May 06, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

12/26/2013

pdf

text

original

 
1.Why is UNIX more portable than other operating system?
Ans
. UNIX is an operating system which is readily available,searchable and has complete documentation both on the systemand online via the internet. Changes can easily do on this operatingsystem. Taking an example, when C programming language wasdeveloped, the UNIX operating system itself was rewritten into C. This enabled UNIX to become the more open portable than otheroperating system today.2.Explain briefly the significance of a UNIX file system?
Ans
. The significance of a UNIX file system can be explained as
:
a.It has excellent use and control of system resources.b.It has very high reliability (long uptimes between reboots).c.It is readily available, searchable, and has completedocumentation both on the system and online via theinternet.d.Massive stores of free software available for downloadingand building.e.It is able to interact with more than one user at a time.3.Distinguish between internal and external commands withexamples.
Ans
. Some commands in UNIX are internal, built into the shell. Forexample, the
cd
command is built
-
in. That is, the shell interpretsthe command and changes the current directory. On the otherhand,
cat
command is an external program stored in the file/bin/cat, which is used to make files. The shell doesn’t start a separate process to run internalcommands. External commands require the shell to run a newsubprocess
;
this takes some time, especially if the system is busy.
4.
Explain the output of the
ls –l
command.
Ans
. The command
ls –l
lists seven attributes of all the files in theworking directory. The top list gives the file mode, which consists of a string of 10 characters. The first column gives the file mode,which consists of a string of 10 characters. The first characterindicates the file type. The nine characters after the file type are thefile permissions, which are displayed in three sets of threecharacters each. The second column gives the number of filenames or linksassociated with the file.(continue....) The third column gives the file ownership. The third columndisplays the owner of the file.
 
 The fourth column shows the group ownership of each file.At the time of user account creation, the system administratorassigns the user to a group. The fifth column displays the file size in bytes. The sixth column gives the date and time of modification of thefiles. The last column gives the name of the file and the list isarranged in the alphabetical order.5.Write a UNIX command to display the current date in the formdd/mm/yyyy.
Ans
. $ date +%D6.Explain the different types of files in UNIX.
Ans
. There are four possible types of file in UNIX:
Ordinary files
:
These files cannot contain text, data, or programinformation. An ordinary file cannot contain another file, or directory. An ordinaryfile can be a text file or a binary file.
Directory files
:
Directories are containers that can hold files, andother directories. A directory is actually implemented as a file that has one line for each item contained within the directory.
Special files
:
These files represent input/output (i/o) devices, like atty (terminal), a disk drive, or a printer. Because UNIX treats such devices as files,some of the commands used to access ordinary files will also work with device files.This allows for more efficient use of software.
Links
:
A link is a pointer to another file. Since a directory is a list of thenames and i-numbers of files, a directory entry can be a hard link, in which the i-number  points directly to another file.
1.Write a UNIX command to count how many users havelogged on to the UNIX system.Ans.
who –q
2.What is a process? Explain the mechanism of processcreation in UNIX system.Ans.
A process is born when a program starts execution and existsas long as the program is running. After execution the process issaid to die. The name of the process is usually the name of theprogram being executed. The creation of a process is in three phases and uses threesystem calls known as fork, exec and wait. ‘fork’ is a system callthat creates a new process from an existing process. The newprocess is called the child process, and the existing process is calledthe parent. The attributes of the parent and child are an identicalimage except for parameters like Parent-ID. The child gets a newParent-ID and the process is forked. This is the mechanism used tomultiply process in the system. The child process overwrites theimage with a copy of program that is to be executed by using the‘exec’ system call. No additional processes are created and the
 
existing program is replaced with a new program. The Parent-ID of this process is the same as that of the child process which wasforked. The ‘wait’ system call is executed by the parent process towait for the child process to get completed. The exit status of thechild process is picked up by the parent process.
3.What is a filter? Explain any five filters in UNIX system.Ans.
Filters are UNIX commands which are used for extractingrelated information from a given file.Five mainly used filters in UNIX are –
a.
Paginating Files, ‘pr’
:-
This command, i.e. ‘pr’, preparesa file for printing by adding suitable headers, footersand formatted text. This command has to be used witha file name as an argument –$ pr emp.lst
 b.
‘head’
:-
This command, as the name implies, displaysthe top of the file. When used without an option, itdisplays the first ten lines of the file. When used with –noption, it displays the first ‘n’ number of lines.$ head emp.lst$ head –n 3 emp.lst
c.
‘tail’
:-
The tail command displays the end of the file(asopposite to head command). Like head, it displays thelast 10 lines when used without arguments and with –noption, it displays the last ‘n’ number of lines.$ tail emp.lst$ tail –n 4 emp.lst
d.
‘cut’
:-
The features of the ‘cutcommand will beillustrated with specific reference to the file “shortlist”,which stores the first five lines of ‘emp.lst’ file. We canextract both columns and fields from this file with the‘cut’ command. Columns are specified with –c optionandfields with –f option.Cut is powerful text manipulator often used incombination with other commands or filtersCut uses the tab as the default field delimiter, but canalso work with different delimiter.
e.
‘grep’
:-
The ‘grep’ command in UNIX is used to searchfor a pattern in a given file. It displays the selectedpattern, the line numbers or the file names where thepattern occurs. The syntax is
:
$ grep options pattern filename(s)‘grep’ searches for pattern in one or more filenames. Thefirst argument is the pattern and ones remaining are filenames.

Activity (4)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads
Komal Gupta liked this
Rahul Kumar liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->