Consider the following UNIX command:

sort <in> temp; head -30 <temp; rm temp

Which of the following functions shall be performed by this command?

(A) Sort, taking the input from "temp", prints 30 lines from temp and delete the file temp

(B) Sort the file "temp", removes 30 lines from temp and delete the file temp

(C) Sort, taking the input from "in" and writing the output to "temp" then prints 30 lines from temp on terminal. Finally "temp" is removed.

(D) Sort, taking the input from 'temp" and then prints 30 lines from "temp" on terminal. Finally "temp" is removed.

1 Answer

Answer :

(C) Sort, taking the input from "in" and writing the output to "temp" then prints 30 lines from temp on terminal. Finally "temp" is removed.

Related questions

Description : What is the function of following UNIX command? WC - lb& (A) It runs the word count program to count the number of lines in its input, a, writing the result to b, as a foreground process. (B) It runs ... (D) It copies the l ' numbers of lines of program from file, a, and stores in file b.

Last Answer : (B) It runs the word count program to count the number of lines in its input, a, writing the result to b, but does it in the background.

Description : Unix command to change the case of first three lines of file “shortlist” from lower to upper (1) $ tr ‘[a-z]’ ‘[A-Z]’ shortlist | head-3 (2) $ head-3 shortlist | tr ‘[a-z]’ ‘[A-Z]’ (3) $ tr head-3 shortlist ‘[A-Z]’ ‘[a-z]’ (4) $ tr shortlist head-3 ‘[a-z]’ ‘[A-Z]’

Last Answer : (2) $ head-3 shortlist | tr ‘[a-z]’ ‘[A-Z]’ 

Description : The command which transcribes the standard input to the standard output and also makes a copy of the same in a file is A. tee B. tr C. sort D. grep E. None of the above

Last Answer : A. tee

Description : What will be the output of the following Unix command ? $rm chap0\[1 - 3\] (A) Remove file chap0[1 - 3] (B) Remove file chap01, chap02, chap03 (C) Remove file chap\[1 - 3\] (D) None of the above

Last Answer : (A) Remove file chap0[1 - 3]

Description : Which command is used to remove a file? A. remove B. rm C. mv D. del E. None of the above

Last Answer : B. rm

Description : Design Phase consists of ……………………. 1. Identity the functions to be performed 2. Design the input/output and file design 3. Defining basic parameters for system design A) 1 & 2 B) 2 & 3 C) 1 & 3 D) 1, 2 & 3

Last Answer : D) 1, 2 & 3

Description : Which command is used to sort the lines of data in a file in reverse order A. sort B. sh C. st D. sort -r E. None of the above

Last Answer : D. sort -r

Description : Which of the following statement is not correct with reference to cron daemon in UNIX O.S? (A) The cron daemon is the standard tool for running commands on a predetermined schedule. (B) It starts ... command lines and the times at which they invoked. (D) Crontab for individual users are not stored.

Last Answer : (D) Crontab for individual users are not stored.

Description : In Unix, the command to enable execution permission for file “mylife” by all is ................ (A) Chmod ugo+X myfile (B) Chmod a+X myfile (C) Chmod +X myfile (D) All of the above

Last Answer : (D) All of the above

Description : In Unix operating system, special files are used to : (A) buffer data received in its input from where a process reads (B) provide a mechanism to map physical device to file names (C ... pointers associated with i-nodes (D) store information entered by a user application program or utility program

Last Answer : (B) provide a mechanism to map physical device to file names 

Description : A segment is any object described by GKS commands and data that start with CREATE SEGMENT and Terminates with CLOSE SEGMENT command. What functions can be performed on these segments? (1) Translation ... 2) Panning and Zooming (3) Scaling and Shearing (4) Translation, Rotation, Panning and Zooming

Last Answer : Translation, Rotation, Panning and Zooming

Description : Is there a unix command to reverse the lines in a file?

Last Answer : answer:tac tac (cat spelled backwards) works like cat, but reverse the order of the lines (last line is written out first).

Description : Let L be the language generated by regular expression 0*10* and accepted by the deterministic finite automata M. Consider the relation RM defined by M. As all states are reachable from the start state, RM has ................ equivalence classes. (A) 2 (B) 4 (C) 5 (D) 6

Last Answer : (D) 6

Description : Consider the situation in which assignment operation is very costly. Which of the following sorting algorithm should be performed so that the number of assignment operations is minimized in general? a) Insertion sort b) Selection sort c) Heap sort d) None

Last Answer : b) Selection sort

Description : A UNIX file system has 1 KB block size and 4-byte disk addresses. What is the maximum file size if the inode contains ten direct block entries, one single indirect block entry, one double indirect block entry and one triple indirect block entry? (A) 30 GB (B) 64 GB (C) 16 GB (D) 1 GB

Last Answer : (C) 16 GB

Description : Consider a disk queue with request for input/output to block on cylinders  98, 183, 37, 122, 14, 124, 65, 67  in that order. Assume that disk head is initially positioned at cylinder 53 and moving ... and 252 cylinders (B) 640 and 236 cylinders (C) 235 and 640 cylinders (D) 235 and 252 cylinders

Last Answer : Answer: 236 and 208 cylinders Explanation: SSTF Initial head position =53 The closest queue to initial head position=65 head moves from 53 to 65=12 head moves from 65 to 67=2 head moves from 67 ... 122=24 head moves from 122 to 124=2 head moves from 124 to 183=59 Total head movement=208 

Description : The Unix command: $ vi file1 file2 (A) Edits file1 and stores the contents of file1 in file2 (B) Both files i.e. file1 and file2 can be edited using ex' command to travel between files (C) Both ... using the mv' command to move between the files (D) Edits file1 first, saves it and the edits file2

Last Answer : (B) Both files i.e. file1 and file2 can be edited using ‘ex’ command to travel between files

Description : Which statement is not correct about “init” process in Unix? (1) It is generally the parent of the login shell. (2) It has PID 1. (3) It is the first process in the system. (4) Init forks and execs a ‘getty’ process at every port connected to a terminal.

Last Answer : It is the first process in the system.

Description : What does the following command do? grep −vn abc x (A) It will print all of the lines in the file x that match the search string abc (B) It will print all of the lines in file x that do not ... (D) It will print the specific line numbers of the file x in which there is a match for string abc

Last Answer : (A) It will print all of the lines in the file x that match the search string “abc”

Description : ECE Board Exam March 1996 What is the transmission rate of a system for transmitting the output of a microcomputer to a line printer operating at a speed of 30 lines/minute? Assume that the line printer has 8 bits ... and prints out 80 characters/line. A. 800 bps B. 400 bps C. 320 bps D. 640 bps

Last Answer : C. 320 bps

Description : Which command is used to display the top of the file? A. cat B. head C. more D. grep E. None of the above

Last Answer : B. head

Description : State True or False. i) In spooling high speed device like a disk is interposed between running program and low-speed device in Input/output. ii) By using spooling for example instead of writing directly to a printer, ... ii-False B) i-True, ii-True C) i-False, ii-True D) i-False, ii-False

Last Answer : B) i-True, ii-True

Description : The directory structure used in Unix file system is called (A) Hierarchical directory (B) Tree structured directory (C) Directed acyclic graph (D) Graph structured directory

Last Answer : (C) Directed acyclic graph

Description : ................. maintains the list of free disk blocks in the Unix file system. (A) I-node (B) Boot block (C) Super block (D) File allocation table

Last Answer : (C) Super block 

Description : A unix file may be of type: (A) Regular file (B) Directory File (C) Device File (D) Any one of the above 

Last Answer : (D) Any one of the above

Description : The Unix Kernel maintains two key data structures related to processes, the process table and the user structure. Which of following information is not the part of user structure? (A) File descriptor table (B) System call state (C) Scheduling parameters (D) Kernel stack

Last Answer : (C) Scheduling parameters

Description : A unix file system has 1-KB blocks and 4-byte disk addresses. What is the maximum file size if i-nodes contain 10 direct entries and one single, double and triple indirect entry each? (A) 32 GB (B) 64 GB (C) 16 GB (D) 1 GB

Last Answer : (C) 16 GB

Description : In Unix, the login prompt can be changed by changing the contents of the file ............... (A) contrab (B) init (C) gettydefs (D) inittab

Last Answer : Answer: C

Description : Which of the following information about the UNIX file system is not correct? (A) Super block contains the number of i-nodes, the number of disk blocks, and the start of the list of free disk blocks. (B ... Each i-node is 256-bytes long. (D) All the files and directories are stored in data blocks. 

Last Answer : (C) Each i-node is 256-bytes long.

Description : To delete a database ................... command is used A) delete database database_name B) Delete database_name C) drop database database_name D) drop database_name

Last Answer : C) drop database database_name

Description : Suppose d = {“john”:40, “peter”:45}, to delete the entry for “john” what command do we use a) d.delete(“john”:40) b) d.delete(“john”) c) del d[“john”]. d) del d(“john”:40)

Last Answer : c) del d[“john”].

Description : Which of the following are the functions of operating system? i) recovering from errors ii) facilitating input/output iii) facilitating parallel operation iv) sharing hardware among users v) implementing user interface A) i, ii, ... only C) ii, iii, iv and v only D) All i, ii, iii, iv and v

Last Answer : D) All i, ii, iii, iv and v

Description : Write Unix command for following: i)create a folder OSY ii) create a file FIRST in OSY folder iii) List/display all files and directories. iv) Write command to clear the screen

Last Answer : i) create a folder OSY: $mkdir OSY ii)create a file FIRST in OSY folder: $cd OSY $cat>FIRST or $ touch FIRST iii) List/display all files and directories: $ls iv) to clear screen: $clear

Description : Based on the identification of objectives, input, output and file content, the vital document is called … A) System Definition B) System Document C) System Requirement Document D) System Subject

Last Answer : B) System Document

Description : Consider a full-adder with the following input values: (a) x=1, y=0 and Ci(carry input) = 0 (b) x=0, y=1 and Ci = 1 Compute the values of S(sum) and C0 (carry output) for the above input values. (A) S=1 , C0= 0 and ... C0= 1 (C) S=1 , C0= 1 and S=0 , C0= 0 (D) S=0 , C0= 1 and S=1 , C0= 0

Last Answer : (A) S=1 , C0= 0 and S=0 , C0= 1

Description : Consider a discrete memoryless channel and assume that H(x) is the amount of information per symbol at the input of the channel; H(y) is the amount of information per symbol at the output of the channel; H(x|y) is the amount of uncertainty ... (H(x) - H(x|y))]  p(x) (D) max H(x|y)  p(x)

Last Answer : (D) max H(x|y)   p(x)

Description : Suppose you want to delete the name that occurs before “Vivek” in an alphabetical listing. Which of the following data structures shall be most efficient for this operation? (A) Circular linked list (B) Doubly linked list (C) Linked list (D) Dequeue

Last Answer :  (B) Doubly linked list 

Description : A perceptron has input weights W1 = -3.9 and W2 = 1.1 with threshold value T = 0.3. What output does it give for the input x1 = 1.3 and x2 = 2.2? (A) -2.65 (B) -2.30 (B) 0 (D) 1

Last Answer : Answer: C

Description : Which of the following sorting algorithm has the running time that is least dependant on the initial ordering of the input? a) Insertion sort b) Quick sort c) Merge sort d) Selection sort

Last Answer : d) Selection sort

Description : Which of the following algorithm pays the least attention to the ordering of the elements in the input list? a) Insertion sort b) Selection sort c) Quick sort d) None

Last Answer : b) Selection sort

Description : If the given input array is sorted or nearly sorted, which of the following algorithm gives the best performance? a) Insertion sort b) Selection sort c) Quick sort d) Merge sort

Last Answer : a) Insertion sort

Description : Consider a sequence F00 defined as: Then what shall be the set of values of the sequence F00? (1) (1, 110, 1200) (2) (1, 110, 600, 1200) (3) (1, 2, 55, 110, 600, 1200) (4) (1, 55, 110, 600, 1200)

Last Answer : Answer: 1 Explanation: We have given, F00(0) = 1, F00(1) = 1 F00(2) = (10*F00(1) + 100)/F00(0) = 110 F00(3) = (10*F00(2) + 100)/F00(1) = 1200 F00(4) = (10*F00(3) + ... (2) = 110 Since the values repeats after the first three values, the set of values of F00 will be (1,110,1200).

Description : Consider the following two commands C1 and C2 on the relation R from an SQL database:  C1: drop table R; C2: delete from R; Which of the following statements is TRUE? I. Both C1 and C2 delete the schema for R. II. C2 ... R. (A) I only (B) I and II only (C) II and III only (D) I, II and III

Last Answer : (C) II and III only

Description : Which command is used to display a file contents in octal form? A. cd B. od C. of D. oct E. None of the above

Last Answer : B. od

Description : Which command is used to count just the number of characters in a file? A. wc - 1 B. wc -c C. wc -w D. wc -r E. None of the above

Last Answer : B. wc -c

Description : The Octal number to be given alogn with chmod command to make a file readable, writable and executable to the owner, readable and executable to group and others is: A. 000 B. 755 C. 744 D. 555 E. None of the above

Last Answer : B. 755

Description : Which command is used to remove the read permission of the file 'note' from both the group and others? A. chmod go+r note B. chmod go+rw note C. chmod go-x note D. chmod go-r, 4-x note E. None of the above

Last Answer : D. chmod go-r, 4-x note

Description : Which command sends the word count of the file infile to the newfile. A. wc infile >newfile B. wc newfile C. wc infile - newfile D. wc infile | newfile E. None of the above

Last Answer : A. wc infile >newfile

Description : Which command is used to extract specific columns from the file? A. cat B. cut C. grep D. paste E. None of the above

Last Answer : B. cut