Home Top Unix Interview Questions

Top Unix Interview Questions

Answer: It is a portable operating system that is designed for both efficient multi-tasking and mult-user functions. Its portability allows it to run on different hardware platforms. It was written is C and lets user do processing and control under a shell.

Answer:

Swapping:
Whole process is moved from the swap device to the main memory for execution. Process size must be less than or equal to the available main memory. It is easier to implementation and overhead to the system. Swapping systems does not handle the memory more flexibly as compared to the paging systems.

Paging:
Only the required memory pages are moved to main memory from the swap device for execution. Process size does not matter. Gives the concept of the virtual memory. It provides greater flexibility in mapping the virtual address space into the physical memory of the machine. Allows more number of processes to fit in the main memory simultaneously. Allows the greater process size than the available physical memory. Demand paging systems handle the memory more flexibly.

Answer: Kernel is the UNIX operating system. It is the master program that controls the computer’s resources, allotting them to different users and to different tasks. However, the kernel doesn’t deal directly with a user. Instead, it starts up a separate, interactive program, called a shell, for each user when he/she logs on.

Answer: The swapper is the only process that swaps the processes. The Swapper operates only in the Kernel mode and it does not uses System calls instead it uses internal Kernel functions for swapping. It is the archetype of all kernel process.

Answer: A shell acts as an interface between the user and the system. As a command interpreter, the shell takes commands and sets them up for execution.

Answer: Page Fault is reffered as the situation when the process addresses a page in working set of process but the process fails to locate the page in working set. And on page fault the kernal update the working set by reading the page from the secondary devices.

Answer: – history mechanism with built-in editor that simulates emacs or vi
– built-in integer arithmetic
– string manipulation capabilities
– command aliasing
– arrays
– job control

Answer: 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.)

Answer: Piping, represented by the pipe character “|”, is used to combine two or more commands together. The output of the first command serves as input the next command, and so on.

Answer: Shell variables are a combination of a name ( identifier), and an assigned value, which exist within the shell. These variables may have default values, or whose values can be manually set using the appropriate assignment command. Examples of shell variable are PATH, TERM and HOME.

Answer: nohup is a special command which is used to run process in background, but it is slightly different than & which is normally used for putting a process in background. An UNIX process started with nohup will not stop even if the user who has stared log off from system. While background process started with & will stop as soon as user logoff.

Answer: Relative path refers to the path relative to the current path. Absolute path, on the other hand, refers to the exact path as referenced from the root directory.

Answer: It is a free shell designed to work on the UNIX system. Being the default shell for most UNIX-based systems, it combines features that are available both in the C and Korn Shell.

Answer:

  1. Fully buffered.
  2. Line Buffered.
  3. Un Buffered.

Answer: The term IPC (Inter-Process Communication) describes various ways by which different process running on some operating system communicate between each other.

Answer: You can check these by using either ping or telnet command in UNIX. This question is most asked in various Unix command Interview because its most basic networking test anybody wants to do it.

Answer: – telnet – used for remote login
– finger – information gathering command
– ping – an echo request for testing connectivity
– su – user switching command
– ftp – file transfer protocol used for copying files

Answer: Signals are software interupts . Signal provide a way of handling asynchronous events: a user at a terminal typing the iterrupt key to stop a program or the next program in the pipeline termnating prematurely.

Answer: Every process is uniquely identified by a process identifier. It is possible to view details and status regarding a process by using the ps command.

Answer: By using export command, for example export count=1 will be available on all sub shell.