Вы находитесь на странице: 1из 15

Q.What is BSS(Block Started by Symbol)? A.UNIX linkers prod ce ninitiali!ed data se"ments.

#he se"ments that contain the pro"ram code and data are called te$t se"ments. #hese se"ments contain initiali!ed data. #he ob%ects in the Block Started by Symbol se"ment contain only a name and si!e b t not the &al e. Q.What is 'a"e(Stealer process? )$plain the pa"in" states *or a pa"e in memory. A.#he pa"es that are eli"ible *or s+appin" are *o nd by the 'a"e(Stealer, and places the pa"e n mbers in a list +hich contains the pa"es to be s+apped. #he pa"in" states are -. .a"in" and is not yet eli"ible *or s+appin", and /. .eli"ible *or s+appin" b t not yet eli"ible *or re assi"nment to other &irt al address space. Q.)$plain the phases o* s+appin" a pa"e *rom the memory. A.#he phases o* s+appin" a pa"e *rom the memory are0 #he eli"ibility *or s+appin" a pa"e +ill *o nd by the pa"e stealer and the pa"e n mber a&ailable in the list o* pa"es +ill be s+apped.#he pa"e is copied by the kernel to a s+ap de&ice and the &alid bit a&ailable in the pa"e table entry clearance is done. #he p*data re*erence co nt +ill be decremented and the p*data table entry is placed at the end o* the *ree list in case its re*erence co nt is 1. Q.What is 2emand 'a"in"? )$plain the conditions *or a machine to s pport 2emand 'a"in". A.#he process o* mappin" a lar"e address space into a relati&ely small amo nt o* physical memory is kno+n as demand pa"in". #he accomplishment o* demand pa"in" is done by implementin" .backin" store,. #he conditions are0 -.'a"es based memory architect re. /.3restartable, instr ctions s pport by the machine Q.2i**erence bet+een 4a lt 5andlers and the Interr pt handlers. A.4a lt handlers can sleep6 +here as interr pt handlers cannot. #he *a lt handler,s sleep sta"e occ rs by the memory *a lt +hich is in conte$t o* the process. Q.What is &alidity *a lt? In +hat +ay the &alidity *a lt handler concl des? A.7alidity *a lt is the res lt o* non settin" o* &alid bits in main memory at the time o* re*ererrin" a pa"e by a process. #his happens +hen the pa"es are a&ailable o tside the &irt al address space o* a process or the pa"es are the part o* the &irt al address space +here the physical address space is assi"ned to it.#he settin" the &alid bit o* the pa"e is the process o* handlin" &alidity *a lt by the +ay o* clearin" the modi*y bit and reclac latin" the process priority. Q.What is e$ and &i? )$plain their p rposes. A.e$6is the line editor mode o* .&i, editor. It allo+s to -.+rite 8IS' pro"rams

/.list all the *iles sa&ed as the res lt o* an editor or system crash 9.pre&ent the accidental o&er+ritin" o* *iles :.encrypt and decrypt the *iles &i ; screen oriented &is al editor. It per*orms almost all the operations that are s pported by e$. It has the additional *eat res to edit6 sa&e lines and *iles. It pro&ides the c rsor mo&ement options6 editin" options. Use* l to +rite shell scriptin" in 8in $<Uni$. Q.)$plain ho+ the =ernel handles both the pa"e stealer and the *a lt handler. A.When the memory shorta"e occ rs then the pa"e stealer and *a lt handler thrashes. #he *a lt handler +ill be slept +hen the s m o* the +orkin" sets o* all the processes is more than the physical memory. #he system thro "hp t red ction is the rest lt o* this process6 beca se the time spent by kernel *or the o&erhead is too m ch. #he memory is rearra"ed in the *rantic pace. Q.What is kill()? )$plain its possible ret rn &al es. A.kill() is a system call +hich stops a process. #he ret rn &al es o* kill() are0 -.1 ; 'rocess is e$istin" +ith the "i&en 'I26 and si"nals can be sent to it. /.- ; #he .errno >> )S?@5, is tr e. #his implies the non(e$istence o* a process +ith a "i&en 'I2 or ca sin" the denial o* system by sec rity enhancements *or its e$istence. 9.(- ; #he .errno >> )')?A, is tr e. #his implies that the kill proess +ill not be allo+ed by the system +ith the "i&en 'I26 +hich implies that the process e$ists or the enhancements are present by draconian sec rity.At times some other &al es ret rned by .errno,. Q.)$plain the steps that a shell *ollo+s +hile processin" a command. A.#he seB ence o* e$ec tin" commands by shell are as *ollo+s0 -.'arsin"0 #he command is broke into +ords6 by sin" the spaces as delimiters nless B oted. #he tabs are replaced by a sin"le space. /.)&al ation o* a &ariable0 #he +ords +ith C as precedin" character +ill be e&al ted nless B oted. 9.@ommand S bstit tion0 #he commands s rro nded by backB otes +ill be e$ec ted by the shell. 8ater these +ill be replaced into standard o tp t o* the command into command line. :.Wild card interpretation0 4inally6 the shell identi*ies all the +ild cards(?6D) in the command line and replaces the +ild card +ith sorted list o* *ile names +hich maches the pattern. E.'A#5 e&al ation0 Ultimately shell looks *or the 'A#5 &ariable *or the p rpose o* determinin" the seB ence o* directories to search *or the *iles or commands. Q.What is the di**erence bet+een cmp and di** commands? 'ro&ide an e$ample *or each. A.cmp Byte by byte comparision per*ormed *or t+o *iles comparision and displays the *irst mismatch byte.

cmp ret rns the -st byte and the line no o* the *ileone to make the chan"es to make the *ileone identical to *ilet+o. 2irectory names can not be sed. di** Indicates the chan"es that are to be done to make the *iles identical.It ret rns the te$t o* *ilet+o that is di**erent *rom *ilet+o.#he 2irectory names can be sed. Q.What is the se o* ."rep, command? 'ro&ide an e$ample A.Frep stands *or re" lar e$pression. ."rep, command is sed to *ind the patterns in a te$t *ile pro&ided by the ser. It ret rns tr e i* the pattern is *o nd in the *ile6 other+ise *alse. )$amples0 "rep 8in *ile- *ile/ *ile9 searches the *iles *ile-6 *ile/6 *ile9 *or the lines +hich contains the strin" 8in. "rep .8in $ learnin" is "reat , *ile- *ile/ *ile9 searches the *iles *ile-6 *ile/6 *ile9 *or the lines +hich contains the strin" .8in $ learnin" is "reat,. "rep (c 8in $ operatinsystems displays only the n mber o* times that the pattern is matched in the *ile b t not the lines. "rep (r 38in s #or&alds3 D searches *or the *iles in c rrent and all the s b directories *or the pattern (8in s #or&alds). Q.2i**erence bet+een cat and more command. A.#he *ile contents are displayed by .cat, command. #he contents +ill scroll o** the screeen6 +hen the *ile contents are more than one screen pa"e.#he *ile contents are displayed pa"e by pa"e +ith the se o* .more, command.)$amples cat lin $.t$t displays the contents o* the *ile lin $.t$t ls ;l G more displays the *ile and directory names. 5alts once the screen pa"e is * ll and prompts to press a key to contin e Q.What is .d , command? What is its se? A.#he d (disk sa"e) command is sed to report the si!e o* directory trees. #hese incl de the contents and the si!e o* all *iles. It is se* l to se d command *or the p rpose o* trackin" do+n the space ho"s. A ho" is an e$cessi&e or lar"e space occ pied by the *iles and directories on a secondary stora"e media.#he command d is mostly

employed by the system administrators. #hey se d as a s pplement to the a tomated monitorin" system pro"rams +hich help to pre&ent the key directories and partitions *rom bein" * ll. Q.)$plain the &ario s prompts that are a&ailable in a UNIX system. A.UNIX s pports : prompts0 -.'S-0 de*a lt prompt /.'S/0 *or the p rpose o* m lti(line inp t 9.'S90 *or printin" the select command :.'S:0 *or printin" be*ore the o tp t i* ;$ is set. Q.2escribe ho+ the kernel di**erentiates de&ice *iles and ordinary *iles. A.#here are / de&ice *iles. #hey are character de&ice *ile and block de&ice *ile. #o distin" ish these t+o6 speci*y b ; *or block de&ice *ile and c ; *or character de&ice *ile in the inode str ct re o* the *ile.An ordinary *ile does not reB ire these *ields. Q.2escribe initial process seB ence +hile the system boots p. A. -) BIHS0 8oads the boot sector *rom the stora"e media. #he order o* bootin" can be chan"ed sin" BIHS. /) (2HS) Aaster Boot ?ecord (AB?)0 2HS option incl des AS(2HS6 Windo+s. #he *irst E-/ bytes o** the disk i.e.6 <de&<had +ill be e$ec ted by BIHS. #he standard AB? looks *or the primary partition i.e.6 <de&.hda-(: +hich is marked bootable. 9) 8I8H0 #he kernel ima"e is to be loaded as it does not nderstand the *ile system code. #he kernel ima"e is persisted as ra+ disk o**sets sin" BIHS ro tines to load the seB ence. #ypically the men code is a&ailable in <boot<boot.b and prompts *or the partition or kernel *or ima"e (8in $) or other (2HS) to load *irst E-/ bytes o* the partition. :) =ernel0 Initiali!es de&ices6 loads .initrd, optionally6 mo nts root *ile system that is speci*ied by lilo or loadin +ith root>parameter. ? ns <sbin<init +hich has the process n mber -('I2 > -) and prints the &ersion n mber. E) <sbin<init0 ?eads the <etc<inittab. )$ec tes the boot scripts debian in t rn r ns <etc<rcS.d<SD scripts6 r ns the pro"rams a&ailable in <etc<inittab. I) ? n 8e&els0 #he de*a lt le&el is de*ined in <etc<inittab. )$0 id0 90 initde*a lt0 #he other le&els are0 1. halt -. sin"le ser /. 4 ll A lti(User modes (de*a lt)

9(E.Same as / I.?eboot Q.What is a shell? What are shell &ariables? A.A shell s an inter*ace to the ser o* any operatin" system. #he sers instr ct an operation to the comp ter by typin" commands as te$t *or the e$ec tion. Shell &ariables are special &ariables. #hey are name and &al e pairs created and maintained by the concerned shell. 4or e$ample0 'A#56 5HA)6 AAI86 #)?A etc. Q.)$plain ho+ the inode maps to data block o* a *ile. A.#here are -9 block addresses in inode. #he *ile descriptions ; type o* *ile6 access ri"hts6 and o+ners6 time stamps o* the *iles6 si!e6 and pointers to data blocks ; are contained in each inode.#he *irst -1 block addresses are called direct block addresses +hich are the data blocks *or the *irst -1 in the *ile.#he --th6 -/th and -9th addresses are pointed to a one(le&el inde$ block and t+o(le&el inde$ block and three(le&el inde$ blocks respecti&ely. Q.)$plain some system calls sed *or process mana"ement. A.#he *ollo+in" are the system calls0 -.*ork() ( 4or creatin" child process /.&*ork() ( 4or creatin" child process only to copy(on(+rite 9.e$ec() ( 4or per*ormin" a di**erent task. :.+ait() ( #o make a process to +ait *or completion o* e$ec tion. E.kill() ( 4or sendin" a si"nal to a process I.si"nal() ( 4or handlin" a si"nal. J.e$it() ( #o e$it o t o* e$ec tion o* a process K.e$it() ( #o e$it o t o* e$ec tion o* a process +itho t clean p. Q.)$plain ho+ to "et<set an en&ironment &ariable *rom a pro"ram. A.In @ pro"rammin" lan" a"e0 An en&ironment &ariable can "et sin" the * nction "eten&(). In Shell scriptin"0 #he en&ironment &ariable itsel* can be sed as0 AAI8L2)8I7)?ML@HA'8)#)>1 'A#5>C'A#50<home<my ser<D.%ar Q.2escribe ho+ a parent and child process comm nicates each other. A.#he inter comm nication bet+een a child process and a parent process can be done thro "h normal comm nication schemes s ch as pipes6 sockets6 messa"e B e es6shared memories. #here are special +ays to inter comm nicate +hich has ad&anta"e o* the relationships.Hne o* the most ob&io s ad&anta"es is that the e$it stat s o* the child process can be obtained by the parent process.By comm nicatin" +ith nnamed pipes6 the creation on pipe sho ld be done be*ore the creation o* child. #his process is called *orkin". Soon a*ter *orkin"6the parent properties +ill be inherited by child6 also the pipe. #he comm nication bet+een parent and child is done +ith this pipe.

Q.What is a 2aemon? A.2aemon is the short *orm *or 2isk and )$ec tion Aonitor. A daemon is a back"ro nd process +hich ans+ers reB ests *or ser&ices in a lon"(r nnin" mode. In UNIX6 the names o* daemons are end +ith.d, con&entionally. Some o* the daemons are Ninetd6 httpd6 n*sd6 sshd6 named6 and lpd N. Q.What is 3ps3 command *or? A.#he shorta"e *or Nprocess stat sO is ps. #his command is sed to display the c rrently r nnin" processes on 8in $<Uni$ systems. It is like task mana"er in Windo+s. #o stop the c rrently r nnin" process *or the p rpose o* "ainin" the system speed6 and *ind o t the processes that are r nnin" on the remote system6 the ps command is a tool. Stoppin" o* a process can be done by kill command. Q.5o+ the S+apper +orks? A.Ao&in" the in*ormation *rom *ast access memory and slo+ access memory and &ice &ersa is kno+n as s+appin". #he physical ?AA is di&ided into ch nks o* memory kno+n as pa"es. A pa"e o* memory is copied to the precon*i" red space on the hard disk6 *or the p rpose o* *reein" p that pa"e o* memory. #o per*orm s+appin"6 the commands s+apon and s+apo** are sed in lin $< ni$. #he s+apon is to enable the s+appin" and the s+apo** is to disable s+appin". Q.What is the di**erence bet+een S+appin" and 'a"in"? A.S+appin" per*orms the +hole process to trans*er to the disk6 +here as pa"in" per*orms the part o* the process is trans*erred to the disk by makin" the rest o* the process a&ailable in the physical memory.'a"e(ins and pa"e(o ts are the processors those are mo&ed *rom and to the physical memory to the disk in pa"in".S+ap(ins and s+ap(o ts are the processes those are mo&ed *rom and to the physical memory to the disk in s+appin". Q.What is )$pansion s+ap? A.)$pansion s+ap is a part o* hard disk. #his is reser&ed *or the p rpose o* storin" ch nks o* a pro"ram that is e$ec tin" +hich is s+apped o t o* the memory in order to make space a&ailable *or other pro"rams. Q.What is 4ork s+ap? A.4or creation o* child process6 *ork() system call is in&oked. At the time o* processin" the *ork() call by parent6 the child process is created. In case o* shorta"e o* memory6 the child process +ill be sent to the read(to(r n state in the s+ap de&ice. It ret rns to the ser state +itho t per*ormin" the s+appin" the state o* parent. Hnce the memory is a&ailable6 the child process s+appin" is done into the main memory. Q. What are the reB irements *or a s+apper to +ork? A.#he * nctionality o* a s+apper is on the sched lin" priority +hich is hi"hest. #he s+apper searches *or sleepin" process. It searches *or the processes that are ready to r n *or s+appin"6 i* the sleepin" process not *o nd.#he reB irement *or the s+apper is to +ork *or the process that is ready to r n and m st be the resident *or at least / seconds

be*ore s+appin" o t. #he process m st be resided in the s+ap de&ice *or at least / seconds6 *or any s+appin". #he s+apper +ill "o into the +ait state6 i* the reB irement is not satis*ied6 *or that e&ent. It +ill be a+aken once in a second by the kernel o* the HS. Q.What is .the principle o* locality,? A.#he ne$t most data item or instr ction is the closest to the c rrent data item or instr ction. 4or e$ample6 a block in a *ile may be the closest one that is needed ne$t. #he HS can read the ne$t block be*ore its need and made a&ailable it on hand at the time o* iss in" the act al read reB est. Q.What is pa"e *a lt? Its types. A.Hne o* the critical parts o* code in the 8in $ kernel. It has a ma%or in*l ence on memory s bsystem,s per*ormance. A process has a pa"e table6 also called as map that contains pa"e table entries that points to the assi"ned memory to the process and comm nicates to the @'U6 the memory locations +hich are &alid *or accessin" a process. )ach process is assi"ned to a memory ch nk named as pa"es. A pa"e table that is does not map memory area access6 +ill res lt in "eneration o* pa"e *a lt by @'U. Q.2i**erence bet+een the *ork() and &*ork() system call. A. -.*ork0 Both the parent and child share all o* the pa"e tables ntil any one o* them does a +rite. #hen pa"in" +ill create pri&ate pa"e copy o* the dirty pa"e *or the p rpose o* modi*yin" process. #his process is done on demand. /.&*ork ( In this system call ntil child e$its or e$ecs6 the parent +ill be s spended. #he memory and stack are shared by the child. Q.What is protection *a lt? A.'rotection *a lt is a name o* an error. #his error occ rs +hen accessin" stora"e space is tried by an application pro"ram +hich is not desi"nated *or its se. 'rotectin *a lt is also most likely to occ r +hen a beta test &ersion o* a so*t+are is tried to access. Q.)$plain se o* pipes. A.Uses o* 'ipe -.Se&eral po+er* l * nctions can be in a sin"le statement /.Streams o* processes can be redirected to ser speci*ied locations sin" P 9.'ipes are se* l to chain p se&eral pro"rams6 so that m ltiple commands can e$ec te at once +itho t sin" a shell script. Q.)$plain trap command6 shi*t @ommand6 "etopts command o* lin $. A.#rap command0 controls the action to be taken by the shell +hen a si"nal is recei&ed. #rap QH'#IHNSR Q Qar"R si"nspec..R Ar" is the action to be taken or e$ec ted on recei&in" a si"nal speci*ied in si"nspec. e.". trap Nrm C4I8)S e$itO << e$it (si"nal) and remo&e *ile (action)

Shi*t @ommand0 Usin" shi*t command6 command line ar" ments can be accessed. #he command ca ses the positional parameters shi*t to the le*t. Shi*t QnR +here n de*a lts to -. It is se* l +hen se&eral parameters need to be tested. Fetopts command0 this command is sed to parse ar" ments passed. It e$amines the ne$t command line ar" ment and determines +hether it is a &alid option Fetopts Toptstrin"U T&ariable-U. 5ere6 optsrin" contains letters to be reco"ni!ed i* a letter is *ollo+ed by a colon6 an ar" ment sho ld be speci*ied. )." (+hether the ar" ment be"ins +ith a min s si"n and is *ollo+ed by any sin"le letter contained inside options ) I* not6 dia"nostic messa"es are sho+n. It is s ally e$ec ted inside a loop. Q.What Stateless 8in $ ser&er? A.A stateless 8in $ ser&er is a centrali!ed ser&er in +hich no state e$ists on the sin"le +orkstations. #here may be scenarios +hen a state o* a partilc ar system is meanin"* l (A snap shot is taken then) and the ser +ants all the other machines to be in that state. #his is +here the stateless 8in $ ser&er comes into pict re.Stateless lin $ is a +ay ho+ a system is to r n and be mana"ed. Bein" a stateless system6 a system sho ld be able to be replaced at any time +ith or +itho t local stora"e media. In case o* hard dri&e crash6 the command resync can be sed to a ne+ dri&e. I* ser&er "oes o**line6 a ne+ &irt al instance that is r nnin" the HS ima"e o** o* the net+ork stora"e. Q.What are the *eat re o* Stateless 8in $ ser&er? A.4eat res0 -.It stores the prototypes o* e&ery machine /.It stores snapshots taken *or those systems 9.It stores home directories *or those systems :.Uses 82A' containin" in*ormation o* all systems to assist in *indin" o t +hich snapshot (o* state) sho ld be r nnin" on +hich system. Q.What does nslook p do? )$plain its t+o modes. A.Nslook p is sed to *ind details related to a 2omain name ser&er. 2etails like I' addresses o* a machine6 AX records6 ser&ers etc. It sends a domain name B ery packet to the correspondin" 2NS.Nslook p has t+o modes. Interacti&e and non interacti&e. Interacti&e mode allo+s the ser to interact by B eryin" in*ormation abo t di**erent hosts and domains.Non interacti&e mode is sed to *etch in*ormation abo t the speci*ied host or domain.#he t+o modes o* nslook p are0 Interacti&e and non(interacti&e. -.Usin" .interacti&e mode, ser can B ery the name ser&ers *or the in*ormation pertainin" to hosts and domains. /.Usin" .non(interacti&e mode, the ser can % st print the name and reB ested in*ormation o* a host. Interacti&e mode0

Nslook p QoptionsR Qser&erR Q.What is Bash Shell? A.Bash is a *ree shell *or UNIX. It is the de*a lt shell *or most UNIX systems. It has a combination o* the @ and =orn shell *eat res. Bash shell is not portable. any Bash( speci*ic *eat re +ill not * nction on a system sin" the Bo rne shell or one o* its replacements6 nless bash is installed as a secondary shell and the script be"ins +ith VW<bin<bash. It s pports re" lar and e$pressions. When bash script starts6 it e$ec tes commands o* di**erent scripts. Bash stands *or XBo rne A"ain ShellO. A shell is the ser inter*ace. Bash is more con&enient shell *or sers amon" others. #he scripts +ritten in Bash are portable amon" machines6 distrib tions and e&en operatin" systems. Q.)$plain some Net+ork(Aonitorin" #ools in 8in $0 pin"6 tracero te6 tcpd mp6 ntop A.Net+ork monitorin" tools are sed to monitor the net+ork6 systems present on the net+ork6 tra**ic etc. -.'in"0 'in" command is sed to check i* the system is in the net+ork or not. #o check i* the host is operatin".e.". pin" ipLaddress When the command is e$ec ted6 it ret rns a detailed s mmary o* the host. 'ackets sent6 recei&ed6 lost by estimatin" the ro nd trip time. /.#racero te0 the command is sed to trace the path taken by the packet across a net+ork. #racin" the path here means *indin" o t the hosts &isited by the packet to reach its destination. #his in*ormation is se* l in deb ""in". ?o ndtrip time in ms is sho+n *or e&ery &isit to a host. 9.#cpd mp0 commonly sed to monitor net+ork tra**ic. #cd mp capt res and displays packet headers and matchin" them a"ainst criteria or all. It interprets Boolean operators and accepts host names6 ip address6 net+ork names as ar" ments. :.Ntop0 Net+ork top sho+s the net+ork sa"e. It displays s mmary o* net+ork sa"e by machines on the net+ork in a *ormat as o* UNIX top tility. It can also be r n in +eb mode6 +hich allo+s the display to be bro+sed +ith a +eb bro+ser. It can display net+ork tra**ic statistics6 identi*y host etc. Inter*aces are a&ailable to &ie+ s ch in*ormation. Q.5o+ does the lin $ *ile system +ork? A.8in $ *ile str ct re is a tree like str ct re. It starts *rom the root directory6 represented by 3<36 and then e$pands into s b(directories. All the partitions are nder the root directory. I* a partition is mo nted (#he mo nt point de*ines the place o* a partic lar data set in the *ile system) any+here apart *rom a Nde&iceO6 the system is not a+are o* the e$istence o* that partition or de&ice. 2irectories that are only one le&el belo+ the root directory are o*ten preceded by a slash6 to indicate their position.

-.?oot X<X *ile system0 #he kernel needs a root *ile system to mo nt at start p. #he root *ile system is "enerally small and sho ld not be chan"ed o*ten as it may interr pt in bootin". #he root directory s ally does not ha&e the critical *iles. Instead s b directories are created. ).". <bin (commands needed d rin" boot p)6 <etc (con*i" *iles) 6 <lib(shared libraries). /.< sr *ilesystem 0 this *ile system is "enerally lar"e as it contains the e$ec table *iles to be shared amon"st di**erent machines. 4iles are s ally the ones installed +hile installin" 8in $. #his makes it possible to pdate the system *rom a ne+ &ersion o* the distrib tion6 or e&en a completely ne+ distrib tion6 +itho t ha&in" to install all pro"rams a"ain. S b directories incl de <bin6 <incl de6 <lib6 <local (*or local e$ec tables) 9.<&ar *ilesystem 0 this *ile system is speci*ic to local systems. It is called as &ar beca se the data keeps chan"in". #he s b directories incl de <cache<man (A cache *or man pa"es)6 <"ames (any &ariable data belon" to "ames)6 <lib (*iles that chan"e)6 <lo" (lo" *rom di**erent pro"rams)6 <tmp (*or temporary *iles) :.<home *ilesystem0 ( this *ile system di**ers *rom host to host. User speci*ic con*i" ration *iles *or applications are stored in the ser3s home directory in a *ile. UNIX creates directories *or all sers directory. )." <home<myLname. Hnce the ser is lo""ed in S he is placed in his home directory. E.<proc *ilesystem 0 this *ile system does not e$ist on the hard disk. It is created by the kernel in its memory to pro&ide in*ormation abo t the system. #his in*ormation is s ally abo t the processes. @ontains a hierarchy o* special *iles +hich represent the c rrent state o* the kernel .4e+ o* the 2irectories incl de <- (directory +ith in*ormation abo t process n m -6 +here - is the identi*ication n mber)6 <cp in*o (in*ormation abo t cp )6 <de&ices (in*ormation abo t de&ices installed)6 <*ilesystem (*ile systems con*i" red)6 <net (in*ormation abo t net+ork protocols)6 <mem (memory sa"e) At the time o* installation o* 8in $6 a *ile system is assi"ned and persists in the hard disk. #his *ile system str ct re resembles a tree. A *ile can be a list o* names and n mbers or e$ec table pro"rams. 8in $ treats e&ery pro"ram as a *ile. 8in $ treats directories and comp ter components also as *iles.A *ile co ld be a list o* names and n mbers6 a cheesecake recipe6 or an e$ec table pro"ram. B t nder 8in $6 e&erythin" is a *ile. In addition to data and e$ec table *iles6 8in $ treats directories and e&en the &ario s components o* yo r comp ter as *iles. It co ld be a keyboard6 console6 and printer6 ?AA or ?HA. #hese are re*erred as special *iles kno+n as de&ices. #hese *iles are a&ailable in <de& directory. 8in $ per*orms the comm nication +ith these de&ices by simply readin" *rom or +ritin" to these special *iles. Q.What are the process states in 8in $? A.#he *ollo+in" are the process states0

-. ? nnin"0 #his is a state +here a process is either in r nnin" or ready to r n. /. Interr ptible0 #his state is a blocked state o* a process +hich a+aits *or an e&ent or a si"nal *rom another process 9. Uninterr ptible0 It is also a blocked state. #he process is *orced to halt *or certain condition that a hard+are stat s is +aited and a si"nal co ld not be handled. :. Stopped0 Hnce the process is completed6 this state occ rs. #his process can be restarted E. Yombie0 In this state6 the process +ill be terminated and the in*ormation +ill still be a&ailable in the process table. Q.What is a !ombie? A.Yombie is a process state +hen the child dies be*ore the parent process. In this case the str ct ral in*ormation o* the process is still in the process table. Since this process is not ali&e6 it cannot react to si"nals. Yombie state can *inish +hen the parent dies. All reso rces o* the !ombie state process are cleared by the kernel.2ead process is called a !ombie. #he processes +ill die e&ent ally at the time +hen they become !ombies. A dead process cannot be killed. #he parent process +ill send a si"nal to the operatin" system that is not needed the !ombie by sin" +ait () system call. Q.)$plain each system calls sed *or process mana"ement in lin $. A.'rocess mana"ement ses certain system calls. #hey are e$plained belo+. -. #o create a ne+ process ; *ork () is sed. /. #o r n a ne+ pro"ram > e$ec () is sed. 9. #o make the process to +ait > +ait () is sed. :. #o terminate the process ; e$it () is sed. E. #o *ind the niB e process id ; "etpid () is sed. I. #o *ind the parent process id ; "etppid () is sed. J. #o bias the c rrently r nnin" process property ; nice () is sed. Q.What is 8in $ and +hy is it so pop lar? A.8in $ is an operatin" system that ses UNIX like Hperatin" system. 5o+e&er6 nlike UNIX6 8in $ is an open so rce and *ree so*t+are. 8in $ +as ori"inally created by 8in s #or&alds and commonly sed in ser&ers.8in $ is a m lti ser6 m ltitask FUI based open so rce operatin" system.'op larity o* 8in $ is beca se o* the *ollo+in" reasons -.It is *ree and open so rce. We can do+nload 8in $ *or *ree and c stomi!e it as per o r needs. /.It is &ery rob st and adaptable. 9.Immense amo nt o* libraries and tilities :.'eople +ho are *amiliar +ith UNIX can +ork on 8in $ +ith ease and com*ort. E.'eople +ho +ant "reat control o&er net+ork sec rity and on operatin" system 'rior to 8in $6 there is UNIX. #he desktop +ork stations *rom &ario s companies +ere based on UNIX. 8ater a n mero s companies entered and each one o* them had their o+n UNIX &ersion. As the proprietary a thority is o+ned by each company and the lack o* central a thority +eaken UNIX. As 8in $ is *ree and r ns on any '@ plat*orm it "ained the pop larity &ery B ickly.

Q.What is 8I8H? A.8I8H is 8in $ 8oader is a boot loader *or 8in $. It is sed to load 8in $ into the memory and start the Hperatin" system. 8I8H can be con*i" red to boot other operatin" systems as +ell. 8I8H is c stomi!able6 +hich means that i* the de*a lt con*i" ration is not correct6 it can be chan"ed. @on*i" *ile *or 8I8H is lilo.con*.8I8H stands *or 8in $ 8oader +hich is a bootstrap pro"ram. 8I8H is a code snippet +hich loads '@ BIHS into the main memory at the time o* startin" the comp ter system. Q.What are the * nctions per*ormed by 8I8H? A.8I8H handles the *ollo+in" tasks0 -.8ocatin" 8in $ kernel /.Identi*yin" other s pportin" pro"rams and loadin" them in the memory 9.Starin" =ernel #he selection o* &ario s kernel ima"es and boot ro tines is s pported by 8I8H. 4or this reason6 8I8H is kno+n as boot mana"er. Q.What is the di**erence bet+een home directory and +orkin" directory? A.5ome directory 0 It is the de*a lt +orkin" directory +hen a ser lo"s in. Hn the other hand6 +orkin" directory is the ser,s c rrent directory. Workin" directory can be chan"ed. It can be chan"ed sin" cd command.5ome directory in 8in $ contains ser,s personal data6 con*i" ration *iles6 settin"s o* a so*t+are etc. #he content o* home directory is pri&ate and the ser has a complete control o* it. Workin" directory0 #he directory in +hich the ser is +orkin" c rrently is kno+n as +orkin" directory. #he home may also be the +orkin" directory6 i* the ser is +orkin" in it. Q.What is the di**erence bet+een internal and e$ternal commands? A.Internal commands are commands that are already loaded in the system. #hey can be e$ec ted any time and are independent. Hn the other hand6 e$ternal commands are loaded +hen the ser reB ests *or them. Internal commands don,t reB ire a separate process to e$ec te them. )$ternal commands +ill ha&e an indi&id al process. Internal commands are a part o* the shell +hile e$ternal commands reB ire a 'ath. I* the *iles *or the command are not present in the path6 the e$ternal command +on,t e$ec te.#he commands that are directly e$ec ted by the shell are kno+n as internal commands. No separate process is there to r n these commands.#he commands that are e$ec ted by the kernel are kno+s as e$ternal commands. )ach command has its niB e process id. Q.)$plain the di**erence bet+een a static library and a dynamic library? A.Static libraries are loaded +hen the pro"ram is compiled and dynamically(linked libraries are loaded in +hile the pro"ram is r nnin". 2ynamic libraries sa&e the ?AA space as a"ainst the static library beca se linkin" to static libraries incl des the act al code *or the library * nction(s)<proced re(s) +ith the e$ec table. 288 code is kept at one location and is s ally shared amon" all the processes that se the 288.Static library has * nctionality that bo nd to a static pro"ram at compile time. )&ery static pro"ram has its o+n copy o* library.2ynamic libraries are loaded into the memory and binds at r n time.

#he e$ternal * nctionality is accessed at r ntime. #his process red ces the o&erall *ootprint o* memory. Q.What is N4S? A.N4S is Net+ork 4ile system. It is a *ile system sed *or sharin" o* *iles o&er a net+ork. Hther reso rces like printers and stora"e de&ices can also be shared. #his means that sin" N4S *iles can be accessed remotely. N*s command in lin $ can be sed to achie&e this. Q.What is its p rpose? A.' rpose o* N4S0 -.N4S can be sed *or sharin" o* *iles remotely. /.2ata can be stored on a sin"le machine and still remain accessible to others o&er the net+ork. 9.?ed ction o* the n mber o* remo&able media dri&es thro "ho t the net+ork since they can be shared. N4S stands *or Net+ork 4ile System. N4S is sed to partition a disk on a remote machine disk. N4S allo+s a B ick +ay o* *ile sharin".#he n+anted people access potential is pro&ided by N4S to access hard dri&e in a net+ork. So that an na thori!ed ser can not access one,s email6 delete the *iles. 4ile ser&ices *rom +indo+s can be accessed. In other +ords *iles *rom one operatin" system can be shared by another sin" N4S. Q.5o+ do I send email +ith lin $? A.)mail can be sent in 8in $ sin" the mail command.8in $ s pports to +ork +ith sendin" mails sin" a set o* commands called as mail commands. #he command to send email is .mail,. #he .mail, command is sed to send and recei&e emails. Synta$0 Aail QoptionsR Q sersR Hptions are0 (s6(c6(b Where ;s *or s b%ect6 (c *or copy and ;b *or blind carbon copy ).". mail serLname ;s NhelloO ).". mail sername ;s N?eports are neededO It prompts displays the s b%ect as N?eports are neededO.Similarly i* ;c and ;b is "i&en the mail +ill be sent to the correspondin" recipients. Q.)$plain ?'A (?ed 5at 'acka"e Aana"er) *eat res. A.?'A is a packa"e mana"in" system (collection o* tools to mana"e so*t+are packa"es).?'A is a po+er* l so*t+are mana"ement tool *or installin"6 ninstallin"6 &eri*yin"6 B eryin" and pdatin" so*t+are packa"es. ?'A is a strai"ht *or+ard pro"ram to per*orm the abo&e so*t+are mana"ement tasks. It is a&ailable +ith 4edora6 S se6 @entHS6 Aandri&a 8in $ and other &ersion o* 8in $.Its *eat res are0 -.?'A can &eri*y so*t+are packa"es. /.?'A can be ser&ed as a po+er* l search en"ine to search *or so*t+are,s.

9.@omponents6 so*t+are,s etc can be p"raded sin" ?'A +itho t ha&in" to reinstall them :.Installin"6 reinstallin" can be done +ith ease sin" ?'A E.2 rin" pdates ?'A handles con*i" ration *iles care* lly6 so that the c stomi!ation is not lost. Q.What is =ernel? )$plain the task it per*orms. A.=ernel is sed in UNIX like systems and is considered to be the heart o* the operatin" system. It is responsible *or comm nication bet+een hard+are and so*t+are components. It is primarily sed *or mana"in" the systems reso rces as +ell.=ernel is the component that is responsible *or mana"in" the reso rces o* a comp ter system. =ernel Acti&ities are0 -.#he =ernel task mana"er allo+s tasks to r n conc rrently. /.Aana"in" the comp ter reso rces0 =ernel allo+s the other pro"rams to r n and se the reso rces. ?eso rces incl de i<o de&ices6 @'U6 memory. 9.=ernel is responsible *or 'rocess mana"ement. It allo+s m ltiple processes to r n sim ltaneo sly allo+in" ser to m ltitask. :.=ernel has an access to the systems memory and allo+s the processes to access the memory +hen reB ired. E.'rocesses may also need to access the de&ices attached to the system. =ernel assists the processes in doin" so.4or the processes to access and make se o* these ser&ices6 system calls are sed. I.'ro&ides the abstraction le&el *or reso rces s ch as memory6 processors6 and I<H de&ices. J.'er*orms inter process comm nication K.?esponds to system calls Z.'ro&ides methods *or synchroni!ation and comm nication bet+een processes. Q.What is 8in $ Shell? A.8in $ shell is a ser inter*ace sed *or e$ec tin" the commands. Shell is a pro"ram the ser ses *or e$ec tin" the commands. In UNIX6 any pro"ram can be the sers shell. Shell cate"ories in 8in $ are0Bo rne shell compatible6 @ shell compatible6 nontraditional6 and historical.8in $ shell is the ser inter*ace to comm nicate +ith 8in $ operatin" system. Shell interprets the ser reB ests6 e$ec tes them. Shell may se kernel to e$ec te certain pro"rams. Shell Script0 A shell script is a pro"ram *ile in +hich certain 8in $ commands are placed to e$ec te one a*ter another. Q.What is Shell Script? A.A shell script6 as the name s ""ests6 is a script +ritten *or the shell. Script here means a pro"rammin" lan" a"e sed to control the application. #he shell script allo+s di**erent commands entered in the shell to be e$ec ted. Shell script is easy to deb "6 B icker as compared to +ritin" bi" pro"rams. 5o+e&er the e$ec tion speed is slo+ beca se it la nches a ne+ process *or e&ery shell command e$ec ted. )$amples o* commands are cp6 cn6 cd.A shell script is a *lat te$t *ile. Shell scripts are se* l to accept inp ts and pro&ide o tp t to the ser. )&eryday a tomation process can be simpli*ied by a shell script.

Q.What are 'ipes? A.A pipe is a chain o* processes so that o tp t o* one process (stdo t) is *ed an inp t (stdin) to another. UNIX shell has a special synta$ *or creation o* pipelines. #he commands are +ritten in seB ence separated by G. 2i**erent *ilters are sed *or 'ipes like AW=6 F?)'.e.". sort *ile G lpr ( sort the *ile and send it to printer).'ipe is a symbol sed to pro&ide o tp t o* one command as inp t to another command. #he o tp t o* the command to the le*t o* the pipe is sent as inp t to the command to the ri"ht o* the pipe. #he symbol is G. 4or e$ample0 C cat apple.t$t G +c. In the abo&e e$ample the o tp t o* apple.t$t *ile +ill be sent as inp t *or +c command +hich co nts the no. o* +ords in a *ile. #he *ile *or +hich the no. o* +ords co nts is the *ile apple.t$t.

Вам также может понравиться