Operating System
Q241.
The shell command find -name passwd -print is executed in /etc directory of a computer system running Unix. Which of the following shell commands will give the same information as the above command when executed in the same directory?Q242.
The contents of the text file t1 txt containing four lines are as follows : a1 b1 a2 b2 a3 b2 a4 b1 The contents of the text file t2 txt containing five lines are as follows : a1 c1 a2 c2 a3 c3 a4 c3 a5 c4 Consider the following Bourne shell script :awk - F ' ' ' {Print $1, $2} ' t1.txt | while read a b ; do awk -v aV = $ a - v by = $b - F ' ' aV = = $1 (print aV, bV, $2 ) ' t2.txt done Which one of the following strings will NOT be present in the output generated when the above script in run? (Note that the given strings may be substrings of a printed line.)Q243.
A process executes the following codefor (i = 0; i < n; i + +) fork( );The total number of child processes created isQ244.
A student wishes to create symbolic links in a computer system running Unix. Three text files named "file 1", "file 2" and "file 3" exist in her current working directory, and the student has read and write permissions for all three files. Assume that file 1 contains information about her hobbies, file 2 contains information about her friends and file 3 contains information about her courses. The student executes the following sequence of commands from her current working directory. ln -s file 1 file 2 ln -s file 2 file 3 Which of the following types of information would be lost from her file system? I.Hobbies II.Friends III.CoursesQ246.
A process executes the following segment of code : for(i = 1; i <= n; i++) fork (); The number of new processes created isQ247.
Which of the following commands or sequences of commands will rename a file x to file y in a Unix system ? I. mv y, x II. mv x, y III. cp y, x (rm x) IV. cp x, y (rm x)Q250.
Consider the following multi-threaded code segment (in a mix of C and pseudo-code), invoked by two processes P1 and P2, and each of the processes spawns two threads T1 and T2:int x = 0; // global Lock L1; // global main () { create a thread to execute foo( ); // Thread T1 create a thread to execute foo( ); // Thread T2 wait for the two threads to finish execution; print(x);} foo() { int y = 0; Acquire L1; x = x + 1; y = y + 1; Release L1; print (y);} Which of the following statement(s) is/are correct?[MSQ]