Sie sind auf Seite 1von 5

1. List out the salient features of Unix.

Multi-user: more than one user can use the machine at a time supported via terminals (serial or network connection) Multi-tasking: more than one program can be run at a time hierarchical directory structure to support the organization and maintenance of files Portability: The system is written in high-level language making it easier to read, understand, change and, therefore move to other machines. The code can be changed and complied on a new machine. Customers can then choose from a wide variety of hardware vendors without being locked in with a particular vendor. Machine-independence: The System hides the machine architecture from the user, making it easier to write applications that can run on micros, mins and mainframes. Hierarchical File System: UNIX uses a hierarchile file structure to store information. This structure has the maximum flexibility in grouping information in a way that reflects its natural state. It allows for easy maintenance and efficient implementation. UNIX shell: UNIX has a simple user interface called the shell that has the power to provide the services that the user wants. It protects the user from having to know the intricate hardware details. Pipes and Filters: UNIX has facilities called Pipes and Filters which permit the user to create complex programs from simple programs. Utilities: UNIX has over 200 utility programs for various functions. New utilities can be built effortlessly by combining existing utilities

2.What is 'inode'? All UNIX files have its description stored in a structure called 'inode'. The inode contains info about the file-size, its location, time of last access, time of last modification, permission and so on. Directories are also represented as files and have an associated inode. In addition to descriptions about the file, the inode contains pointers to the data blocks of the file. If the file is

large, inode has indirect pointer to a block of pointers to additional data blocks (this further aggregates for larger files). A block is typically 8k. Inode consists of the following fields: a) File owner identifier b) File type c) File access permissions d) File access times e) Number of links f) File size g) Location of the file data

3. How do you change File Access Permissions? Every file has following attributes: owner's user ID ( 16 bit integer ) owner's group ID ( 16 bit integer ) File access mode word 'r w x -r w x- r w x' (user permission-group permission-others permission) r-read, w-write, x-execute To change the access mode, we use chmod(filename,mode). Example 1:

To change mode of myfile to 'rw-rw-r--' (ie. read, write permission for user - read,write permission for group - only read permission for others) we give the args as: chmod(myfile,0664) . Each operation is represented by discrete values 'r' is 4 'w' is 2 'x' is 1 Therefore, for 'rw' the value is 6(4+2).

Example 2: To change mode of myfile to 'rwxr--r--' we give the args as: chmod(myfile,0744).

4. What is a shell? A shell is an interactive user interface to an operating system services that allows an user to enter commands as character strings or through a graphical user interface. The shell converts them to system calls to the OS or forks off a process to execute the command. System call results and other information from the OS are presented to the user through an interactive interface. Commonly used shells are sh,csh,ks etc.

5. Define file descriptor. A file descriptor is a nonnegative integer. When an file is opened or newly created the kernel returns the file descriptor to the process. The kernel will refer all open files by file descriptor. 6. Differentiate system call and Library functions.

The library functions can be replaced if desired where as the system calls cannot be replaced. To determine the current date and time unix specifies since Epoch: midnight, January1, 1970,Coordinated Universal time. Whereas library provides various daylight savings time. System call provides minimal interface where as library function provie elaborate functionality.

7. Differentiate hard link and symbolic link. Hard link can be created by the super user only where as symbolic link can be created by ordinary user also. Hard link can be created only for file name where as symbolic link can be used to link file and directory. Hard link should be present in same partition where as symbolic link can be present in any partition.

8.How can you get/set an environment variable from a program? Getting the value of an environment variable is done by using 'getenv()'. Setting the value of an environment variable is done by using 'putenv()'.

9.What is a zombie? When a program forks and the child finishes before the parent, the kernel still keeps some of its information about the child in case the parent might need it - for example, the parent may need to check the child's exit status. To be able to get this information, the parent calls 'wait()'; In the interval between the child terminating and the parent calling 'wait()', the child is said to be a 'zombie' (If you do 'ps', the child will have a 'Z' in its status field to indicate this.)

10. Define the signal and specify the actions taken place. Signal is an asynchronous event . When the signal occurs it can a. Ignore the signal b. Take the default action

c. Specify the operation to be carried out.

Das könnte Ihnen auch gefallen