Linux - Part Ii: Asad 1/1/2012
Linux - Part Ii: Asad 1/1/2012
Linux - Part Ii: Asad 1/1/2012
LINUX PART II
Asad 1/1/2012
Table of Contents
Table of Contents.................................................................................................................2 Linux interview questions....................................................................................................3 What is Kernel? Explain the task it performs. ...................................................................3 What are Pipes? Explain uses of pipes................................................................................4 What Stateless Linux server? What feature it offers?..........................................................5 What is Bash Shell?.............................................................................................................6 What are the process states in Linux?..................................................................................8
Page | 2
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.
Page | 3
Page | 4
Page | 5
Page | 6
/home filesystem: - this file system differs from host to host. User specific configuration files for applications are stored in the user's home directory in a file. UNIX creates directories for all users directory. E.g /home/my_name. Once the user is logged in ; he is placed in his home directory. /proc filesystem : this file system does not exist on the hard disk. It is created by the kernel in its memory to provide information about the system. This information is usually about the processes. Contains a hierarchy of special files which represent the current state of the kernel .Few of the Directories include /1 (directory with information about process num 1, where 1 is the identification number), /cpuinfo (information about cpu), /devices (information about devices installed), /filesystem (file systems configured), /net (information about network protocols), /mem (memory usage)
Page | 7
Page | 8
Zombie is a process state when the child dies before the parent process. In this case the structural information of the process is still in the process table. Since this process is not alive, it cannot react to signals. Zombie state can finish when the parent dies. All resources of the zombie state process are cleared by the kernel
System calls used for Process management: Fork () :- Used to create a new process Exec() :- Execute a new program Wait():- wait until the process finishes execution Exit():- Exit from the process Getpid():- get the unique process id of the process Getppid():- get the parent process unique id Nice():- to bias the existing property of process
Page | 9