Top Unix Interview Questions

Top Unix Interview Questions

Q1 What is parsing?

Parsing is the process of breaking a command line into words. This is made possible by using delimiters and spaces. In the event that tabs or multiple spaces are part of the command, these are ultimately replaced by a single space.

Q2 What is a session?

A session is a collection of one or more process groups. A process establishes a new session by calling the setSid function. This function returns procedure groupid ok.

Top Unix Interview Questions

Q3 What is UNIX?

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

Q4 What is the difference between swapping and paging?

The entire process is moved from the swap device to main memory for execution. The process size must be less than or equal to the available main memory. It is easy to implement and has no overhead on the system. Swapping systems do not handle memory more flexibly than paging systems.

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

Read Also – Top Unix Shell Scripting Interview Questions and Answers

Q5 What is kernel?

The kernel is the UNIX operating system. It is the master program that controls the computer’s resources, allocating them to different users and different tasks. However, the kernel does not deal directly with a user. Instead, it starts a separate, interactive program, called a shell, for each user when he or she logs on.

Q6 How does Swapper work?

Swapper is the only process that swaps processes. The swapper works only in kernel mode and it does not use system calls rather it uses internal kernel functions for swapping. This is the core of all kernel processes.

Q7 What is Shell?

The 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.

Q8 What is page fault?

Page fault is referred to as the situation when the process addresses a page in the working set of the process but the process fails to locate the page in the working set. And on page faults the kernel updates the working set by reading the pages from secondary devices.

Q9 What are the main characteristics of corn shell?

  • History mechanism with built-in editor that emulates Emacs or Vi
  • built-in integer arithmetic
  • String manipulation capabilities
  • command aliasing
    – arrays
    -task control

Q10 What is zombie process in UNIX? How do you find zombie process in UNIX?

When a program forks and the child terminates before the parent, the kernel still keeps some of its information about the child, for example the parent may need it, the parent needs the child You may need to check the exhaust status of. To be able to get this information, the parent calls ‘wait()’; In the interval between the child terminating and the parent saying ‘wait()’, the child is said to be a ‘zombie’ (if you do ‘ps’, there is a line in the child’s status field to indicate this. Will be ‘Z’.)

Q11 What is piping?

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

Q12 What are shell variables?

A shell variable is a combination of a name (identifier) and a specified value, which exists within the shell. These variables may have default values, or whose values can be set manually using the appropriate assignment commands. Examples of shell variables are PATH, TERM and HOME.

Q13 What is nohup in UNIX?

nohup is a special command that is used to run a process in the background, but it is slightly different from & which is commonly used to run a process in the background. UNIX processes started with nohup will not be closed even if the user has logged off from the system. Whereas the background process started with & and will stop as soon as the user logsoff.

Q14 Differentiate relative path from absolute path.

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

Q15 What is Bash Shell?

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

Q16 What types of buffers are supported by Unix?

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

Q17 What is IPC? What are the different plans available?

The term IPC (Inter-Process Communication) describes the various ways by which different processes running on some operating systems communicate between each other.

Q18 How do you know if a remote host is alive or not?

You can check these using the ping or telnet command in UNIX. This question is most commonly asked in various UNIX command interviews as it is the most basic networking test that one would want to perform.

Q19 Enumerate some of the most commonly used network commands in UNIX

  • Telnet – used for remote login
  • finger – order to collect information
  • Ping – an echo request to test connectivity
    -su – user switching command
  • FTP – File Transfer Protocol used to copy files

Q20 What is signal?

Signals are software interrupts. Signals provide a way to handle asynchronous events: a user at the terminal types the interrupt key to stop a program or cause the next program in the pipeline to terminate prematurely.

Q21 Is it possible to view information about a process while it is executing?

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

Q22 How do you set environment variables that will be accessible as a sub shell?

For example, using the export command with export count = 1 will be available on all sub shells.

Q23 Why is it not appropriate to use root as the default login?

The root account is very important, and with misuse, it can easily damage the system. This is because the security measures that normally apply to user accounts do not apply to the root account.

Q24 What is the use of T command?

The t command does two things: receiving data from a standard input and sending it to standard output; The second is that it redirects a copy of that input data to the specified file.

Q25 What are process states in UNIX?

As a process is executed it changes its state according to its circumstances. Unix processes have the following statuses:

  1. Running: The process is either running or ready to run.
  2. Wait: The process is waiting for an event or resource.
  3. Stopped: The process has been stopped, usually by receiving a signal.
  4. Zombie: The process has terminated but has not been removed from the process table.
Mahesh Wabale
Latest posts by Mahesh Wabale (see all)

Leave a Comment