Home > Question & Answers > Linux server side Interview Question & Answers part-1

Linux server side Interview Question & Answers part-1

  • Sharebar

Linux server side Interview Question & Answers part-1

What is Linux and why
is it so popular?

Linux is a multiuser, multitask GUI
based open source operating system developed by Linus Torvalds

Torvalds has invited the community to
enhance the Linux kernel and thousands of system

programmers worked on to enhance.
Prior to Linux, there is UNIX. The desktop work stations from

various companies were based on UNIX.
Later a numerous companies entered and each one of them

had their own UNIX version. As the
proprietary authority is owned by each company and the lack of

central authority weaken UNIX. As
Linux is free and runs on any PC platform it gained the popularity

very quickly. The following are few
more reasons for its popularity:

- People who are familiar with UNIX
can work on Linux with ease and comfort.

- People who want great control over
network security and on operating system

What is LILO?

LILO stands for Linux Loader which is
a bootstrap program. LILO is a code snippet which loads PC

BIOS into the main memory at the time
of starting the computer system. LILO handles the following

tasks:

-Locating Linux kernel

-Identifying other supporting programs
and loading them in the memory

-Staring Kernel

The selection of various kernel images
and boot routines is supported by LILO. For this reason, LILO

is known as boot manager.

What is the
difference between home directory and working directory?

Home Directory: Every user will have
one home directory and will have complete control over it. On

login, home is the default working
directory for the user. It contains the configuration files and

responsible for login and logout of
the user.

Working directory: The directory in
which the user is working currently is known as working

directory. The home may also be the
working directory, if the user is working in it.

What is the
difference between internal and external commands?

The commands that are directly
executed by the shell are known as internal commands. No separate

process is there to run these
commands. The commands that are executed by the kernel are knows

as external commands. Each command has
its unique process id.

Explain the
difference between a static library and a dynamic library.

Static library has functionality that bound to a static program at compile time. Every static program

has its own copy of library. Dynamic
libraries are loaded into the memory and binds at run time. The

external functionality is accessed at
runtime. This process reduces the overall footprint of memory.

What is
LD_LIBRARY_PATH?

LD_LIBRARY_PATH is an environment
variable. This is used to search for the shared objects /

dynamic libraries by the operating
system for extendable functionality at runtime.

What is the file
server in Linux server?

A file server is dedicated for
persisting files in a location from which the networked systems can

access. Certain access privileges can
be set for files.

Linux has software named as ‘samba’
which allows the files to be shared, viewed and edited on any

remote system which may has Windows 9
x/ME/2000/NT or Macintosh computer systems. These

files on the file server are backed up
from time to time. If a file is deleted inadvertently, the file can be

recovered from the backup tape.

What is NFS? What is
its purpose?

NFS stands for Network File System.
NFS is used to partition a disk on a remote machine disk. NFS

allows a quick way of file sharing.
The unwanted people access potential is provided by NFS to

access hard drive in a network. So
that an unauthorized user can not access one’s email, delete the

files. File services from windows can
be accessed. In other words files from one operating system

can be shared by another using NFS.

How do I send email
with Linux?

Linux supports to work with sending
mails using a set of commands called as mail commands. The

command to send email is ‘mail’. The ‘mail’
command is used to send and receive emails.

Syntax:

mail [options] [users]

Options are: -s,-c,-b

Where –s for subject, -c for copy and –b
for blind carbon copy

Ex: mail username –s “Reports are
needed”

It prompts displays the subject as “Reports
are needed”.

Similarly if –c and –b is given the
mail will be sent to the corresponding recipients.

Explain RPM (Red Hat
Package Manager) features.

RPM is a powerful software management
tool for installing, uninstalling, verifying, querying and

updating software packages. RPM is a
straight forward program to perform the above software

management tasks. It is available with
Fedora, Suse, CentOS, Mandriva Linux and other version of

Linux.

What is Kernel?
Explain the task it performs.

Kernel is the component that is
responsible for managing the resources of a computer system.

The tasks are:

- Provides the abstraction level for
resources such as memory, processors, and I/O devices.

-Performs inter process communication

-Responds to system calls

-Provides methods for synchronization
and communication between processes.

What is Linux Shell?
What is Shell Script?

Linux shell is the user interface to
communicate with Linux operating system. Shell interprets the user

requests, executes them. Shell may use
kernel to execute certain programs. Shell Script: A shell

script is a program file in which
certain Linux commands are placed to execute one after another. A

shell script is a flat text file.
Shell scripts are useful to accept inputs and provide output to the user.

Everyday automation process can be
simplified by a shell script.

What are Pipes?
Explain use of pipes.

Pipe is a symbol used to provide
output of one command as input to another command. The output of

the command to the left of the pipe is
sent as input to the command to the right of the pipe. The

symbol is |.

For example:

$ cat apple.txt | wc

In the above example the output of
apple.txt file will be sent as input for wc command which counts

the no. of words in a file. The file
for which the no. of words counts is the file apple.txt.

Pipes are useful to chain up several
programs, so that multiple commands can execute at once

without using a shell script.

Explain trap command;
shift Command, getopts command of linux.

trap command is used to catch a signal
that is sent to a process. An action is taken based on the

signal by using the action which is
defined in the trap command instead of taking the default effect on

the process.

Example:

$ trap “echo ‘interrupt signal
received’ “ INT.

shift command is used to replace the
parameters that were sent from command line. For example

$ shift will replace $1 by $2

getopts command is used for the
purpose of parsing positional parameters.

What Stateless Linux
server? What feature it offers?

Stateless linux is a way how a system
is to run and be managed. Being a stateless system, a system

should be able to be replaced at any
time with or without local storage media. In case of hard drive

crash, the command resync can be used
to a new drive. If server goes offline, a new virtual instance

that is running the OS image off of
the network storage.

What does nslookup
do? Explain its two modes.

Nslookup is a program used to find
information about internet Domain Name server.

The two modes of nslookup are:
Interactive and non-interactive.

Using ‘interactive mode’ user can
query the name servers for the information pertaining to hosts and

domains.

Using ‘non-interactive mode’ the user
can just print the name and requested information of a host.

What is Bash Shell?

Bash stands for “Bourne Again
Shell”. A shell is the user interface. Bash is more convenient shell for

users among others. The scripts
written in Bash are portable among machines, distributions and even

operating systems.

Explain some
Network-Monitoring Tools in Linux: ping, traceroute, tcpdump,

ntop

ping: Used to check whether
the system is in the network or not and sends Internet Control Message

Protocol ECHO_REQUEST packets to the
hosts of network.

traceroute: Prints the route
packets which were taken by the network host. traceroute utilizes the

internet protocol’s ‘time to live’
field and elicits an ICMP TIME_EXCEEDED response. This response

is elicited from every gateway
including the path to one of the hosts.

tcpdump: To dump traffic over
a network tcpdump command is used. The headers of the packets

over a network interface are printed
if the given Boolean expression is true. ntop: Network top

program. It displays the summary of
network usage of systems over network in a format which is

reminiscent of unix top utility. If
used in web mode, it displays the result on the web browser.

How does the Linux
file system work?

At the time of installation of Linux,
a file system is assigned and persists in the hard disk. This file

system structure resembles a tree.

A file can be a list of names and
numbers or executable programs. Linux treats every program as a

file. Linux treats directories and
computer components also as files.

A file could be a list of names and
numbers, a cheesecake recipe, or an executable program. But

under Linux, everything is a file. In
addition to data and executable files, Linux treats directories and

even the various components of your
computer as files. It could be a keyboard, console, and printer,

RAM or ROM. These are referred as
special files known as devices. These files are available in /dev

directory. Linux performs the
communication with these devices by simply reading from or writing to

these special files.

What are the process
states in Linux?

The following are the process states:

1. Running: This is a state
where a process is either in running or ready to run.

2. Interruptible: This state is
a blocked state of a process which awaits for an event or a signal from

another process

3. Uninterruptible: It is also
a blocked state. The process is forced to halt for certain condition that a

hardware status is waited and a signal
could not be handled.

4. Stopped: Once the process is
completed, this state occurs. This process can be restarted

5. Zombie: In this state, the
process will be terminated and the information will still be available in the

process table.

What is a zombie?

Dead process is called a zombie. The
processes will die eventually at the time when they become

zombies. A dead process cannot be
killed. The parent process will send a signal to the operating

system that is not needed the zombie
by using wait () system call.

Explain each system
calls used for process management in linux.

Process management uses certain system
calls. They are explained below.

1. To create a new process – fork ()
is used.

2. To run a new program = exec () is
used.

3. To make the process to wait = wait
() is used.

4. To terminate the process – exit ()
is used.

5. To find the unique process id –
getpid () is used.

6. To find the parent process id –
getppid () is used.

7. To bias the currently running process property – nice
() is used.

  1. No comments yet.
  1. No trackbacks yet.

Uses wordpress plugins developed by www.wpdevelop.com Copy Protected by Chetans WP-Copyprotect.