Linux Admin Related Questions & Answers


What is Linux and why is it so popular?


Answer
Linux is an operating system that uses UNIX like Operating system. However, unlike UNIX, Linux is an open source and free software. Linux was originally created by Linus Torvalds and commonly used in servers.

Popularity of Linux is because of the following reasons

     It is free and open source. We can download Linux for free and customize it as per our needs.

     It is very robust and adaptable.

     Immense amount of libraries and utilities

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?


Answer
Home directory is the default working directory when a user logs in. On the other hand, working directory is the user’s current directory. Working directory can be changed. It can be changed using cd command. 

Home directory in Linux contains user’s personal data, configuration files, settings of a software etc. The content of home directory is private and the user has a complete control of it.   

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

What is the file server in Linux server?


Answer
File server is used for file sharing. It enables the processes required fro sharing. All the files can be stored at a centralized location. Linux uses Samba to view the files on the server. Files on this server are backed up on a regular basis. Rights can be also assigned for the files on a file server.

What is NFS? What is its purpose?


Answer
NFS is Network File system. It is a file system used for sharing of files over a network. Other resources like printers and storage devices can also be shared. This means that using NFS files can be accessed remotely. Nfs command in linux can be used to achieve this.   

Purpose of NFS:

     NFS can be used for sharing of files remotely.

     Data can be stored on a single machine and still remain accessible to others over the network.

     Reduction of the number of removable media drives throughout the network since they can be shared.

How do I send email with linux?


Answer
Email can be sent in Linux using the mail command.

Mail [options] [users]

Options include: -s for subject, -c for carbon copy, -b for blind carbon copy

E.g. mail user_name –s “hello”   

Explain RPM (Red Hat Package Manager) features.


Answer
RPM is a package managing system (collection of tools to manage software packages).

Features:

     RPM can verify software packages.

     RPM can be served as a powerful search engine to search for software’s.

     Components, software’s etc can be upgraded using RPM without having to reinstall them

     Installing, reinstalling can be done with ease using RPM

     During updates RPM handles configuration files carefully, so that the customization is not lost.  


What is Kernel? Explain the task it performs.

Answer
Kernel is used in UNIX like systems and is considered to be the heart of the operating system. It is responsible for communication between hardware and software components. It is primarily used for managing the systems resources as well. 

Kernel Activities:

     The Kernel task manager allows tasks to run concurrently.

     Managing the computer resources: Kernel allows the other programs to run and use the resources. Resources include i/o devices, CPU, memory.

     Kernel is responsible for Process management. It allows multiple processes to run simultaneously allowing user to multitask. 

     Kernel has an access to the systems memory and allows the processes to access the memory when required. 

     Processes may also need to access the devices attached to the system. Kernel assists the processes in doing so.

     For the processes to access and make use of these services, system calls are used.   

What is Linux Shell? What is Shell Script?


Answer
Linux shell is a user interface used for executing the commands. Shell is a program the user uses for executing the commands. In UNIX, any program can be the users shell. Shell categories in Linux are:  

Bourne shell compatible, C shell compatible, nontraditional, and historical.

A shell script, as the name suggests, is a script written for the shell. Script here means a programming language used to control the application. The shell script allows different commands entered in the shell to be executed. Shell script is easy to debug, quicker as compared to writing big programs. However the execution speed is slow because it launches a new process for every shell command executed. Examples of commands are cp, cn, cd.

What are Pipes? Explain use of pipes.


Answer
A pipe is a chain of processes so that output of one process (stdout) is fed an input (stdin) to another. UNIX shell has a special syntax for creation of pipelines. The commands are written in sequence separated by |. Different filters are used for Pipes like AWK, GREP. 

e.g. sort file | lpr ( sort the file and send it to printer)

Uses of Pipe

     Several powerful functions can be in a single statement

     Streams of processes can be redirected to user specified locations using >  



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.