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 match the search string “abc” (C) It will print total number of lines in the file x that match the search string “abc” (D) It will print the specific line numbers of the file x in which there is a match for string “abc”

1 Answer

Answer :

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

Related questions

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

Description : Which symbol will be used with grep command to match the pattern pat at the beginning of a line? A. ^pat B. $pat C. pat$ D. pat^ E. None of the above

Last Answer : A. ^pat

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 : 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 : Which of the following is not a communication command. A. write B. mesg C. mail D. grep E. None of the above

Last Answer : D. grep

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 : Which of the following commands is used to update access and modification times of a file? A. grep B. wc C. touch D. cat E. None of the above

Last Answer : C. touch

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 : 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 : Which command is used to concatenate all files beginning with the string 'emp' and followed by a non-numeric characters? A. cat emp[!0-9] B. more [emp][!0-9] C. cat emp[x-z]

Last Answer : A. cat emp[!0-9]

Description : Which command is used to change protection mode of files starting with the string emp and ending with 1,2, or 3? A. chmod u+x emp[l-3] B. chmod 777 emp* C. chmod u+r ??? emp D. chmod 222 emp? E. None of the above

Last Answer : A. chmod u+x emp[l-3]

Description : Consider the following JAVA program: public class First { public static int CBSE (int x) { if (x < 100) x = CBSE (x +10); return (x - 1); } public static void main (String[] args){ System.out.print(First.CBSE(60)); } } What does this program print? (1) 59 (2) 95 (3) 69 (4) 99

Last Answer : (2) 95 

Description : Which command is used to copy all files having the string chap and any two characters after that to the progs directory? A. cp chap?? progs B. cp chap* progs C. cp chap[12] /progs/*.*

Last Answer : A. cp chap?? progs

Description : To remove string “hello” from list1, we use which command ? a) list1.remove(“hello”) b) list1.remove(hello) c) list1.removeAll(“hello”) d) list1.removeOne(“hello”)

Last Answer : d) list1.removeOne(“hello”)

Description : With suitable examples differentiate between grep and fgrep command.

Last Answer : grep command fgrep command grep is an acronym that stands for "Global Regular Expressions Print". fgrep is an acronym that stands for "Fixed-string Global Regular Expressions ...   Example: fgrep support myfile.txt Search for support in the myfile.txt

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 : 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 : The ..................... is essentially used to search for patterns in target string. A) Like Predicate B) Null Predicate C) In Predicate D) Out Predicate

Last Answer : A) Like Predicate

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 : In what way is a file more flexible than a String?

Last Answer : Ans: A file is stored permanently in a storage device.It is easy to access a file whenever required. On the other hand, a string is stored temporarily in RAM, and the contents of a string will be erased automatically when the power is switched off or when the program execution is terminated.

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 : 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 remove a file? A. remove B. rm C. mv D. del E. None of the above

Last Answer : B. rm

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 : 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 : For using a specific database …………… command is used. A) use database B) databasename use C) Both A &B D) None of them

Last Answer : A) use database

Description : Which of the following are the network services? A) File service B) Print service C) Database service D) All of the above

Last Answer : D) All of the above

Description : Match the following. a) Completeness i) How long does it take to find a solution b) Time Complexity ii) How much memory need to perform the search. c) Space Complexity iii) Is the strategy guaranteed to find the solution when there in ... , b-ii, c-iii C) a-iii, b-i, c-ii D) a-i, b-iii, c-ii

Last Answer : C) a-iii, b-i, c-ii

Description : Suppose that we have numbers between 1 and 1000 in a binary search tree and want to search for the number 364. Which of the following sequences could not be the sequence of nodes examined? (A) 925, 221, 912, 245, 899, ... 926, 203, 912, 241, 913, 246, 364 (D) 3, 253, 402, 399, 331, 345, 398, 364 

Last Answer : (C) 926, 203, 912, 241, 913, 246, 364

Description : The Assistant is -. 1) an application that allows you to take notes and save them in a file 2) an animated character that provides help and suggestions 3) a button on the standard Toolbar that executes the Print command 4) a collection of frequently misspelled words in a dictionary file

Last Answer : 2) an animated character that provides help and suggestions

Description : Which symbol is used to separate more than one command in the same command line? A. $ B. # C. : D. ;

Last Answer : D. ;

Description : Which of the following statements is not true for Multi Level Feedback Queue processor scheduling algorithm? (A) Queues have different priorities. (B) Each queue may have different scheduling algorithm (C) ... to a queue (D) This algorithm can be configured to match a specific system under design

Last Answer : (C) Processes are permanently assigned to a queue

Description : Which is the correct statement(s) for Non Recursive predictive parser? S1: First(α) = {t | α => * t β for some string β } => *tβ S2: Follow(X) = { a | S => * αXa β for some strings ... and S2 is correct. (C) S1 is correct and S2 is incorrect. (D) Both statements S1 and S2 are correct. 

Last Answer : (D) Both statements S1 and S2 are correct.

Description : Consider a window bounded by the lines : x = 0; y= 0; x = 5 and y = 3. The line segment joining (–1, 0) and (4, 5), if clipped against this window will connect the points (A) (0, 1) and (2, 3) (B) (0, 1) and (3, 3) (C) (0, 1) and (4, 3) (D) (0, 1) and (3, 2)

Last Answer : (A) (0, 1) and (2, 3)

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 : A relation R={A,B,C,D,E,F,G} is given with following set of functional dependencies: F={AD→E, BE→F, B→C, AF→G} Which of the following is a candidate key? (A) A (B) AB (C) ABC (D) ABD

Last Answer : Answer: D

Description : The simplified form of a Boolean equation (AB’+AB’C+AC)(A’C’+B’) is : (A) AB’ (B) AB’C (C) A’B (D) ABC

Last Answer : (A) AB’

Description : What is the output when following statement is executed ? >>>print('new' 'line') a) Error b) Output equivalent to print ‘new\nline’ Page No 22 c) newline d) new line

Last Answer : c) newline

Description : hat is the output when following code is executed ? >>>print r"\nhello" The output is a) a new line and hello b) \nhello c) the letter r and then hello d) error

Last Answer : d) error

Description : String Processing --- Write out a function that prints out all the permutations of a string. For example, abc would give you abc, acb, bac, bca, cab, cba.

Last Answer : void PrintPermu (char *sBegin, char* sRest) { int iLoop; char cTmp; char cFLetter[1]; char *sNewBegin; char *sCur; int iLen; static int iCount; iLen = strlen(sRest); if (iLen == 2) { iCount++; ... printf("\nEnter a string:"); scanf("%s%*c",sIn); memset(s,0,255); PrintPermu(s, sIn); }

Description : Consider a program that consists of 8 pages (from 0 to 7) and we have 4 page frames in the physical memory for the pages. The page reference string is :  1 2 3 2 5 6 3 4 6 3 7 3 1 5 3 6 3 4 2 4 3 4 5 ... to fill available page frames with pages): (A) 9 and 6 (B) 10 and 7 (C) 9 and 7 (D) 10 and 6

Last Answer : (B) 10 and 7

Description : Consider the reference string 0 1 2 3 0 1 4 0 1 2 3 4 If FIFO page replacement algorithm is used, then the number of page faults with three page frames and four page frames are .......... and ........... respectively. (A) 10, 9 (B) 9, 9 (C) 10, 10 (D) 9, 10

Last Answer : (D) 9, 10

Description : The number of strings of length 4 that are generated by the regular expression (0|∈) 1+2* (3|∈), where | is an alternation character, {+, *} are quantification characters, and ∈ is the null string, is: (A) 08 (B) 10 (C) 11 (D) 12

Last Answer : (D) 12

Description : Suppose that the virtual Address space has eight pages and physical memory with four page frames. If LRU page replacement algorithm is used, .............. number of page faults occur with the reference string. 0 2 1 3 5 4 6 3 7 4 7 3 3 5 5 3 1 1 1 7 2 3 4 1 (A) 11 (B) 12 (C) 10 (D) 9

Last Answer : (A) 11

Description : Suppose d = {“john”:40, “peter”:45}. To obtain the number of entries in dictionary which command do we use? a) d.size() b) len(d) c) size(d) d) d.len()

Last Answer : b) len(d)

Description : The mv command changes (A) the inode (B) the inode-number (C) the directory entry (D) both the directory entry and the inode

Last Answer : (C) the directory entry

Description : The virtual address generated by a CPU is 32 bits. The Translation Lookaside Buffer (TLB) can hold total 64 page table entries and a 4-way set associative (i.e. with 4- cache lines in the set). The page size is 4 KB. The minimum size of TLB tag is (A) 12 bits (B) 15 bits (C) 16 bits (D) 20 bits

Last Answer : (C) 16 bits Explanation: VirtualAddress = 32 bits PageSize = 4KB = 12 bits therefore : VPNTag = 20 bits, OffsetTag = 12 bits TLBEntryLength = VPNTag = 20 bits TotalTLBEntries = 64, 4-way implies ... therefore : TLBIndex = 4 bits TLBTag = TLBEntryLength - TLBIndex = 20 - 4 = 16 bits

Description : Why is the ‘S’ of String capital?

Last Answer : A: Since String is a class.