OS 3rd IA Questions
OS 3rd IA Questions
used to add tw F@ON tn te a Ssuyject When Sending ans, Y Teh con be © Enel Sept or [beth Commend Simple + Cxen ob helps GS avtomate our Ru leylevel ge A det te con that to leq bone jones youtine™ taste Ft Gao be hawaly oily montiny eb 7 Sys Cro 49 Fa tog tevel | ‘Scanned with CamScannerHb) Sheu inbeep olive cycle * 4. Shou tosuu, the prompt cynol watts, 40% you Custer) fe entre a command ardised , thy Chill Scans corarrand a Ate a Command % onck sapamcls AbhumtoKone dre \e ro clhn Crowe Cus to weet eimpiefted Coananands, 3. df Sun paris on ht command Unt to Kuwnel {27 execution 4. Tae Shih wots jos te vom mowmaliy Cont do anything us sunning 2. -AflLA stay Com and shy ushole. CY Read f commend y Display Gntenpoet Prompt Commard - Q execute _/ command ° and &o compre anol we the Command rromd gar executcal tthe prompt reap pect ue & repeater agakn : Scanned with CamScanner~ Medone” erection ~ * ways VK Coy : ate mmands Qerneevate seyne wut 0% LUE MEEK GS OH 5, tmnt Mal, and equire Unpul fern te lemminal * in the Context q avclfarction yAhe word tesminal tndicols the “ceteny digptouy or Keyboard The cetittics geleclect 10 -Leeumbaal acct olont -thevougin 8 ir D Cand act Fapurt & The fle Cos étvearn) repereecnting input, uchich ie connects to Keylooard . The SL fe represents 3 infork Gousces + othe hey boas’ (defante Source ) + Asie using acdine en leith < Gymbel - + Anothes propam uastng a pipeline . 2) Bandand cretput : The fle Cov Stoeam) wwepretenting output, which is Connected to ofaplay . "ALL tH Commands deploying tte output en tu reaumninal actually wurtte to the Standard wudk put yak os a sioeam of Chavacas 2 The tumimal - the ef orte dustination + ® {Me Using Git aedivectien Suyarbels sand >S o NE ‘unpet to another propam uring a pipeline - Scanned with CamScannera wo -- . ' a (ree 3) Standard cesracr * 2 polcere toundké c Before wv Landi ‘4 the, Concept of sanded ccotor use Chrontd enderitand the Concept Of file descodiptor SAGES Ceteripor doa numins attached te eae of tte three gtandocd fetes. sh fee openend by refesutring cto Gi pathname, but Sulos quer moot and write Opearat? ows identity ae fou by This yle dancnipror othe een maintains oo Lawl af file cluscediptors fo exergy procs Ausoneng tn Bu Syston OF Standard Unpack 1 CLanddrd ocput 8 ctondanrd cecsune Scanned with CamScanner“see, Aut ani gy Speetint ites op [dew (Natt : p Joe [oly - g}drvirutl ustal gtre ( ‘ al ep Ot the date usitlen to et pe WLM prrgram carcalites . dota ho this fate, Ch ie Progen thas Computed the mean " Gate waite gpemnotion But tm fot & olor mething Beak ta peices — arene rent ot yer Jost wront She Chatueel a Command wot udp ef command . =the -feceesces a but not She will be vetry eG ube Ef grep Auto Tea le > Johny [rine shen echo * Found! tle ecko “Net tound " 4 D dew ltty + 86 Gtouncls fon tie Corcteunttiorg tewminal jon tt Cup process - Te 4nd cut uchteh tty atu atioshe d cto unhich precere Me the “pe — a" Command at thy hut prompé * | guy} a“ somuning uthe a Linki to tie actually tuys tuaice mami vetth some adelitfenat fees ere Programm une “Gr potwt| Entra new padtnrord + a feo Sly - echo Peek peresicord < [dev ley . Petre, “In entre agaun’” Ne Scanned with CamScannerRead pacuvord & A/dew [eG ptr] In’ ctig echo : echo “ Posaword = “4 password . CHO” Pacsworda = “¢ password a. eho Auden.” ‘Scanned with CamScanner4.1. INTRODUCTION TO awk — AN ADVANCED FILTER AWK is one of the most prominent text-processing utility. It made its entry into the UNIX system in 1977. AWK derives its name from its authors — Aho, Weinberger and Kemighan. It combines the features of several filters. The awk command is a powerful method for processing or analyzing text files, which are organizes as rows and columns. Unlike other filters, awk operates at the field level and can easily access, transform and format individual fields in a line. It can accept extended regular expressions (ERE) for pattem matching. It has C-type programming constructs, variables and several built-in functions. Simple awk commands can be run on command line, whereas more complex tasks should be written as awk programs or awk scripts in files. In Linux, awk is used as gawk (GNU awk). 4.2 SIMPLE awk FILTERING The syntax of awk command is — awk options 'selection_criteria {action)’ file(s) Here, the selection_criteria is a form of addressing and it filters input and selects lines. The action indicates the action to be taken upon selected lines, which must be enclosed within the flower brackets. The selection_criteria and action together constitute an awk program enclosed within single quotes. The selection_criteria in awk can be a pattern as used in context addressing. It can also be a line addressing, which uses awk’s built-in variable NR. The selection_criteria can be even a conditional expressions using && and || operators. Consider the following example of awk command to select all the directors in the file emp.lst. $ awk '/director/(print}' emp.1st 9876|jai sharma |director|production|03/12/50|7000 2365|barun sengupta|director|personnel | 05/11/47! 7800 1006|chanchal sanghvi|director|sales|09/03/38/6700 6521|lalit chowdury|director|marketing|09/26/45| 8200 Here, the selection criteria is /director/which selects the lines containing director. The action is (print). If the selection criteria is missing, then action applies to all the lines. If action is missing, then entire line is printed. The print statement prints the entire line, when it is used without any field specifier. It is a default action of awk. Scanned with CamScanner1.7.8 The if Condition One of the important requirements in programming is conditional structures. In shell programming, the conditional construct /f can be used in the following ways — command is successful | | :£ command is successful | | i¢ command is successful then then then execute commands execute commands execute commends ES else e14£ command is successful execute commands Format 1 fi execute commands £ command is successful Format 2 nen Scanned with CamScannerScanned with CamScanner