OSA _Unit 4

Matoshri College of Engineering and Research Center Nasik Department of Computer Engineering Architecture (OSA) UNIT - IV Class : S.E.Comp Subject : OSA Sr. Correct Mark Question Option A Option B Option C Option D No. Option s A popular boot loader used by most Linux 1 FIFO LILO LIFO None B 3 distributions to boot Linux is called LILO can also be used to boot other 2 MS-DOS Windows 98 Windows NT All of these D 2 operating systems as well such as …….. LILO can be installed to either ……..of 3 MBR to the boot record both a and b None C 2 Linux root partition. 4 What is LILO ? List in list out last in last out Linux Loader None C 2 5 LILO’s configuration file is /etc/lilo.conf lilo.config etc/lilo.config None A 2 Other boot loaders which can be used to 6 load Linux exist: GRUB LOADLIN both a and b None C 2

The kernel itself is a program that usually lives in the root partition of the 7 filesystem. Most Linux distributions call it /vmlinuz /kernel /root None A 3 _____and it often a symbolic link to the real kernel file which lives in “/boot”. After the kernel is brought in from disk into initialize the system's initialize the initialize the 8 main memory, it begins execution and one None B 2 kernel system’s hardware. system's RAM of the first things it does is ………… All those cryptic messages you see fly by when the Linux kernel first starts up are compiled-in kernel 9 compiled-in-RAM compiled-in-root None C 3 messages from the______initializing drivers and configuring your hardware.

Page 1 OSA _Unit 4

The first program the kernel attempts to 10 execute after basic system initialization is fork init kill None B 3 complete is called ______is to take over the complete the 11 init’s job after basic system initialization is system start-up system bootstrap both a and b None C 3 procedure The actual program which the Linux kernel 12 executes as the init process can be specified "kernel" "init" "root" None B 3 via the ______command line parameter.

The system start-up scripts are executed by ______when the system starts up and it is these scripts which are responsible for 13 init kernel root None A 3 completing the bootstrap process of the UNIX system.

14 Styles of system start-up scripts… The System V style The BSD style both a and b None C 3 All start-up scripts are typically kept in a 15 directory named ______which usually init.d init.c intit.e None A 2 lives somewhere under “/etc” Each start-up script can usually accept at 16 start and stop start and pause start and resume None A 3 least two command line arguments: creation of processess and Loading and Device detection 17 Steps in boot process______execution of All of these D 3 initialzation of kernel and configuration system starup scripts

Page 2 OSA _Unit 4

Probe the bus for locate and initialize devices and ask Hardware configuration while Check what hardware 18 each device as the appropriate All of these D 3 includes_____ present specified drivers for information Which is the earliest and most widely used 19 C Korn Shell Bourne Shell Smith Shell C 2 shell that came with the UNIX system? None of the 20 Environment variables can be accessed by System programs C programs Shell scripts C 3 above Which of the following shell scripts looping None of the 21 features does not recognize the break While Until For D 2 above command? 22 Which of the following is not a filter? cat wc grep sort A 2 Are not Are another name for Execute faster than Are executed by a 23 Shell functions executed by new D 2 shell procedures shell procedures new shell shell Provides security talks to the Is the file 24 The shell does the following in Unix Is the user interface A 2 to files hardware manager

25 kernel shell security system file manager B 2 "bash" is an example of a Which of the following is not a component 26 home directory password group ID kernel D 3 of a user account?

27 Master Supreme Root President 1 The name of the Superuser is Read and write 28 The Superuser can Create accounts Delete accounts files in user All the above D 1 accounts Who needs to possess the superuser System Department President of the 29 Ordinary users B 1 account? administrator manager company

Page 3 OSA _Unit 4

To use a Unix system with a GUI you 30 need this type of window to enter Unix Terminal Dialog box Dos Command A 3 commands Multiple Unix commands can be put into a 31 Pipe Script Link Shell B 2 file to form a program. This is called a To get to the on-line reference manual, None of the 32 Manual Online Man C 1 you use this command above Berkeley admin None of the 33 The letters "bash" stand for Born after shell Bourne again shell B 2 shell above 34 To invoke "bash" you type bsh sh bsh Either A or C C 3 The last character of the "bash" prompt is 35 $ # % ? A 1 usually The part of the Unix operating system that 36 GNU project The kernal The shell Linux C 2 interacts with the hardware is called To start a process in the background, enter 37 $ # & % C 1 the command with this character at the end. Which of the following is not a major Unix 38 X shell C shell bash shell Korn shell C 2 shell? 39 A personal run control file for bash is .cshrc profile .bsh .bashrc D 1 User interface with Provides a 40 The shell in the Unix system is the Outer layer of a seed the operating Both B and C D 2 prompt system Simplifying complex Automating None of the 41 Applications of Shell programming include Both A and B C 2 jobs repetitive tasks above Compiled Shell command 42 Another term for shell programs is Scripts C programs A 1 programs language Command Compiled None of the 43 Shell programs are Interpreted processed B 1 above 44 A shell program is a Binary file Text file Linked file C 1

Page 4 OSA _Unit 4

Keeps complex Other programmers Comments in a shell program are important You may revise an 45 programs may try to read All of the above D 1 because old program understandable your program Flow control in a shell program allows None of the 46 Repeatedly Conditionally All of the above C 3 parts of a shell program to be executed above None of the 47 Fi Endif End A 2 In "bash", "if" constructs are ended with above Which of the following is not a iterative 48 IF For Until While A 3 construct in "bash"? A loop that continues indefinitely is called None of the 49 Indefinite loop Non-stop loop Infinite loop C 2 a above Any combination of Any combination The asterisk is a metacharacter which in the None of the 50 Any single character one or more of zero or more C 3 command "ls *.txt" means above characters characters Represents any string of characters Is an "asterisk" or 51 A metacharacter is any character that Is taken literally All of the above B 2 that fit its definition "question mark"

Which of the following Unix utilities are 52 not commonly used to process regular Grep Sed Cut Awk C 3 expressions? Which programming language has a 53 C++ Perl Pearl C B 2 powerful regular expression engine? Which meta-noncharacter is used to 54 ^ ? > $ D 3 indicate the end of the line? Which meta-noncharacter is used to 55 ^ ? < $ A 3 indicate the beginning of the line? Delimiter 56 The character separating fields is called a Separator Blank Semicolon B 3

Page 5 OSA _Unit 4

"Awk" is a program that is primarily concerned with formatting output. It is 57 Records Characters Fields Strings C 1 designed to work best with pieces of data called the flat cable from a small the flat cable that the disk controller additional memory intialization 58 A bootstrap is : connects the CPU to D 2 card to the disk device program to start thre printer driver up the computer

Which process checks to ensure the 59 componenets of the computer and Booting processing saving editing A 2 operating system are connected properly ?

system software system software is application manages application software is unnecessary software is stored hardware wheras The main difference between application composed of program wheras application 60 in memory whereas application D 2 and system software is that ……… instruction but system software must be system software is software software is not present on the only the cap performs user computer tasks

Boss India Operating Basic Input Basic Input Boston Input 61 BIOS stands for ………. C 1 system Operating System Output System Output System 128 byte 62 What is size of master boot record ? 256 byte segment 512 byte segment 1024 byte segment B 1 segment The master boot The master boot record The master boot record is the is the information in the record contains 63 What is master boot record ? information in the All of these A 1 first sector of any hard information about first sector of any floopy

Page 6 OSA _Unit 4

Greedy Grand unified boot Greater Rochester None of the 64 GRUB stands for ……… Reclamation of A 2 loader Urban Bounty above unused Bandwidth By default, GRUB reads its default boot /boot/grub/splash.x 65 /boot/grub/menu.lst /boot grub.config A 2 configuration from……… pm.gz To enter command line mode from GRUB 66 d c find boot B 2 boot screen, type______At run level ______the system is 67 4 3 1 0 D 2 complelety shut down. Which command is used for changing init's 68 inittab telinit restart chkconfig B 3 run level once the system is up ? setting the runlevel getting the present and can be used to attribute of the 69 Runlevel System command is used for previous runlevel of the restart or reboot all of the above D 3 system in the system the system inittab file Pick the run level to run Linux in Multi 70 0 3 5 6 B 2 user mode with networking ______What command be used to find the systems show level 71 runlevel level rlevel previous A 3 previous run level ? previous You want to have the process /etc/myprocess run when the system enters 5:3.once:/etc/myproces 3:4:once:/etc/mypr once:3:4:/etc/myp once:5:3:/etc/my 72 A 2 run level 3. Which of the following inittab s ocess rocess process entries would accomplish this ? Which of the following syslog.config kern.warning/dev/ kern error 73 entries would cause kernel error message Kern warning console kern.error console C 3 console console to be sent to the system console ? What option can be used with shutdown command to send a warning message 74 shutdown -k shutdown -w shutdown -a shutdown -c A 2 alerting users that the system will be shutdown ?

Page 7 OSA _Unit 4

You want there to be 3 grace days after a use the useradd check the delay Use the useradd password expires before an account Edit the user's 75 command with the -f option in user command with A 3 becomes disabled. How would you do this user.config file switch admin the -d switch ? You want to install lilo. Which of the 76 following would you do to accomplish this lilo -u remove lilo uninstall lilo lilo -r A 2 ? You want to view a listing of previously 77 enetered commands. What command hist histfile showbuff history D 3 would you use ? You want to add files to a previously use the tar use the tar created tar file. You want to replace use the append use the add 78 command with the - command with D 2 existing files with newer files, how can you command command t switch the -u switch do this ? Practical Extraction Post Expression Practical Extraction and None of the 79 Perl stands for ______and Ready and Report A 3 Report language above language Language What is output of following perl program ? 80 SCALAR empty value STRING "not a reference" B 2 My $val='x'; print ref($val); can handle a is an effective multi is easy to learn and is available in all variety of tasks tasking langugae that use, but awkward major operating 81 perl ______involving large D 3 requires a great deal of when dealing with system, but is amounts of data development time. compex tasks. quite expensive with ease What is the first line in every perl script The shebang line The standard out The perl 82 that contains special instructions to the The perl interpreter line B 2 The perl statement line statement operating system ? retrives data from the prompts the user outputs a string 83 The print function ______user while a script is for specific modifies a string D 3 to standard out executing information

Page 8 OSA _Unit 4

Perl statements Meta characters are Perl statements are Parameters must Which of the following is true of all Perl are always 84 always preceded by a always followed by always followed D 2 scripts ? followed by a forward slash a period by period semicolon always operate are the building in the same include string are defied two blocks of more 85 Scalar variables ______manner as C 3 exclusively discrete values complicated data variable in structure algebric function Which of the following expression 86 .. . ** * B 2 operators increments a varibale by one ? performing type retrieving data prompting the outputting a STDIN, or standard in, is a mechanism for 87 conversion from the user while user for specific string to B 1 ______automatically a script is executing information standard out Perl is scripting language which is based on 88 inerpreter compiler assembler all of the above A 2 ______89 Perl define scalar variable by ______@ % $ # C 3 90 What is the extension of the perl file ? .p .pl .perl .pe B 3 91 which is escape character in perl ? // ! \ | C 2 comments are placed inside a perl program 92 @ % $ # D 2 file using the ______character un-ordered list of scalar ordered list of ordered list of none of the 93 An array, in perl, is an ______B 2 data scalar data numbers above performs performs a logical performs a logical The logical operator op1 && op2 means performs a logical not alogical AND 94 or of the two and of the two C 2 ______of the operand then OR of the operands operands two operands greater than and 95 Perl uses this <=> operator for ______equal comparision less than or equal B 2 equal

Page 9 OSA _Unit 4

Perl chomp function checks It deletes the last perl chomp function perl chomp whether the last ending varibale Which of the following statements is NOT will not remove all function returns the 96 character matches character D 2 TRUE statements ? whitespace characters number of the input line regardless of by default characters removed separator and only whatever it is. then it deletes it.

Default file accessed through a print 97 STDIN STDOUT STDERR All of these B 2 statement in perl is ______It is object oriented it is software it is assembly 98 What is python ? it is intrpreter A 3 programming language package language In python, the list L contains the following elements : ['A', 1,'1','George']. Which of the None of the 99 L[1:2] X=L[0:1] X=[L[0:2] C 2 following ways of slicing would assign only above the first two elements to the variable X ? none of the 100 "//" in pyhon is ______floor division operator comment new line A 3 above none of the 101 "**" in python is an ______exponentiation address of value redirection A 3 above In python, multi line string are given by none of the 102 single quotes double quotes triple quotes C 3 ______above python source code file has an extension of none of the 103 pys py src B 2 ______above which of the following translate and execute programe statements in sequence, 104 Procedure interpreter paradigm compiler B 1 instead of having separate translation and execution steps ? Which of the following procedure a true or 105 Control structure Strong typing Data Types Boolean Expression D 2 false result ?

Page 10 OSA _Unit 4

Which of the following language has an IF 106 perl chomp function will C++not remove all whitespacePython characters by Alldefault of these D 1 statement for making decision ? Which of following language does not 107 Java C++ Python VB.Net C 2 requires declarations ? Which of the following is not a valid data 108 int float double str C 2 type in python ? 109 How do you find out what's your shell ? echo $shell echo $shell echo $shell echo shell A 2 110 What is command to find out todays date ? Time date cal cd B 2 What's the command to find out users on 111 Who whoami user pwd A 2 the system ? How do you find current directory you are 112 Cd pwd chdir mkdir B 2 in ? Which variable contains current shell 113 $* $? $$ $! C 2 process id ? Which command is used to debug a shell 114 set set -x debug db B 1 script program ? 115 How do you remove a file ? del rm cd rmdir B 2 116 How do you find your own username ? Who user whoami root C 2 Which of the following display content of 117 cat file1 cat > file1 cat >> file2 cat A 2 file1 ? Which of the following creates a file named 118 cat file1 cat > file1 cat < file1 cat B 2 file1 ? What are the files attributes for executing 119 666 755 766 777 B 2 perl programs ? 120 What is default administrator username ? administrator admin superuser root D 2 Simplifying complex Automating None of the 121 Applications of Shell programming include Both A and B C 2 jobs repetitive tasks above 122 The name of the Unix scheduling utility is Sched Cron Sc Timer B 2 Examples of repetitive tasks performed by 123 Disk space inventories Security audits System backups All of the above D 2 system administrators

Page 11 OSA _Unit 4

Command None of the 124 Another term for shell programs is Compiled Interpreted B 1 processed above 125 A shell program is a Binary file System file Text file Linked file C 3 More than one 126 The Unix slang for " #! " is Hash-bang Shboom Shebang D 3 of the above Keeps complex Other programmers Comments in a shell program are important You may revise an 127 programs may try to read All of the above D 2 because old program understandable your program Can be used only Which of the following is not true of Can be exported to the 128 within the shell Can hold data All of the above C 3 program variables entire system program Flow control in a shell program allows None of the 129 Repeatedly Conditionally All of the above D 2 parts of a shell program to be executed above Shell script is preferable to other forms of Makes programming Enhances 130 Occupies less space All of these D 3 programming because it task easier portability Shell scripts can accept Shell scripts are Shell scripts are 131 Choose the incorrect statements. Shell scipts are interpreted D 1 arguments interpreted compiled Files that store data in the same format as 132 binary files Executable file Source file Core D 2 used in program are called Which of the following file names can be 133 date passwd bin Both b and c D 3 found in more than one directoy? 134 Which of the following is not a filter? cat wc grep sort A 1 Are not Are another name for Execute faster than Are executed by a 135 Shell functions executed by new D 2 shell procedures shell procedures new shell shell Which one of the following options is not a 136 Bourne Shell C Shell Net Shell Korn Shel C 3 shell in UNIX system? Which command is used to display the top 137 Cat More Head C 2 of the file?

Page 12 OSA _Unit 4

To analyze a C None of the 138 Lint should be used Before compilation After compilation A 3 code above The statement z = ‘expr 5 / 2′ would store 139 0 1 2 2.5 C 2 which of the following values in z? 140 The expression expr -9 % 2 evaluates to: 0 1 -1 2 C 3 What is the output of the following program?b = [ -n $b ] 141 1 1 2 2 0 0 0 1 C 1 echo $? [ -z $b ] echo $? What is the output of the following program? [ -n $HOME ] 142 echo $? 0 1 1 0 0 0 1 1 A 2 [ -z $HOME ] echo $?

What is the output of the following program? x = 3; y = 5; z = 10; if [( $x -eq 3 ) -a ( $y -eq 5 -o $z -eq 10 )] then 143 1 3 5 error B 1 echo $x else echo $y fi

What is the return value ($?) of this code:os = Unix 144 0 1 2 3 D 1 [$osName = UnixName] && exit 2 [${os}Name = UnixName] && exit 3

Page 13 OSA _Unit 4

What is the output of the following code: 1.Unix 2.Unix 3.Unix 1.Unix 2.Unix 1.Unix 2.Unix 1.Unix 2.$os 145 s=Unix B 1 4.Unix 3.$os 4.Unix 3.Unix 4.$os 3.$os 4.$os echo 1.$os 2."$os" 3.'$os' 4.$os which of these is NOT a valid variable in _1var (underscore _var_ (underscore some-var (some 146 __ (double underscore) D 2 bash 1 var ) var underscore) hyphen var)

What will be output of following The process id is The process id is The process id is 147 The process id is $$ C 2 command:$ echo "The process id is" $$$$ $$ $$$$

What would be the current working directory at the end of the following command sequence? $ pwd /home/user1/proj /home/user1/proj/sr /home/user1/proj 148 /home/user1/proj /home/user1 D 2 $ cd src c /src/generic $ cd generic $ cd . $ pwd How do you print the lines between 5 and cat filename | head | tail -cat filename | head | cat filename | tail cat filename | tail 149 A 3 10, both inclusive 6 tail -5 +5 | head -5 | head -10 Create a new file “new.txt” that is a cp file.txt file2.txt cat file1.txt file2.txt mv file[12].txt ls file1.txt 150 B 2 concatenation of “file1.txt” and “file2.txt” new.txt > new.txt new.txt file2.txt | new.txt The current shell If a file with execute permissions set, but The file is passed to The system returns None of the 151 will try to execute C 3 with unknown file format is executed /bin/sh an error mentioned it Shell is a wrapper Shell is a process and Shell is a built-in for all the None of the 152 Which of the following is true? can be started by C 2 Kernel functionality commands and mentioned superuser only utilities The prompt can Which is true with regards to the shell It can be accidentally The prompt cannot None of the 153 be customized C 3 prompt erased with backspace be modified mentioned (modified)

Page 14 OSA _Unit 4

the thing that a program through a window rides on the back 154 What is a shell in UNIX? which users can issue management the login screen A 2 of a turtle in commands to UNIX system UNIX Which of the following represents an 155 ../home/file.txt bin/cat cs2204/ /usr/bin/cat D 3 absolute path? The user bhojas logged in and performed the following sequence of command. What /home/bhojas/project/m /usr/bhojas/project 156 will be the output of the last command? $ /home/project/mod project/module1 A 3 odule1 /module1 cd project/module1 ule1 $ pwd Basic to Advanced Big & Advanced 157 BASH shell stands for? Bourne-again Shell Basic Access Shell A 3 Shell Shell Which of the following files will not be 158 reminder receipt Receipt recipe-cake C 3 displayed by the command cat re* ? Write standard Write standard none of the 159 The redirection 2> abc implies Write file 2 to file abc C 2 output to abc error to abc mentioned Write standard Write standard output and Write standard output to abc & 160 cmd 2>&1 > abc will Write file2 to file1 D 2 standard error to error to abc standard error to abc monitor Write standard Write standard output and Write standard output to abc & 161 cmd > abc 2>&1 will Write file2 to file1 B 2 standard error to error to abc standard error to abc monitor Which of these is the correct method for echo foo >> echo foo | /tmp/bar < echo 162 echo foo > /tmp/bar B 2 appending “foo” in /tmp/bar file? /tmp/bar /tmp/var foo Syntax to suppress the display of command command 2> 163 command > &2 command 2> &1 command 2> &2 D 3 error to monitor? /dev/null

Page 15 OSA _Unit 4

The following commands gives the output like this #cat file1 file2 #cat: file1: No such file or directory cat: file1: No such file No output is Cat: 1>2: No such 164 hello B 3 hello or directory hello displayed file or directory If we execute the command “cat file1 file2 1>2 2>&1” the output would be file1 content will be file1 content will be appended to file2 file2 and file3 will 165 cat < file1 >> file2 | file3 appended to file2 and syntax error D 3 and file3 will be have same content finally stored in file3 ignored Write data into a Executing cat /etc/password > /dev/sda as Write data to the None of the 166 regular file called it B 3 superuser will physical device sda above /dev/sda rom where would the read statement read if t would read all the following statements were executed? It would read all the It would not read It would read 167 the files in reverse B 3 exec < file1 exec < file2 exec < file3 read files any files only file3 order line

Page 16