A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

1. 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^
View Answer Report Discuss Too Difficult!
Answer: (a).^pat

2. 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
View Answer Report Discuss Too Difficult!
Answer: (d).sort -r

3. Which command is used to display the top of the file?
a. cat
b. head
c. more
d. grep
View Answer Report Discuss Too Difficult!
Answer: (b).head

4. 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/*.*
d. cp chap?? /progs/*
View Answer Report Discuss Too Difficult!
Answer: (a).cp chap?? progs

5. 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[1-3]
b. chmod 777 emp*
c. chmod u+r ??? emp
d. chmod 222 emp?
View Answer Report Discuss Too Difficult!
Answer: (a).chmod u+x emp[1-3]

6. Which command is used to remove a directory?
a. rd
b. rmdir
c. dldir
d. rdir
View Answer Report Discuss Too Difficult!
Answer: (b).rmdir

7. Which of the following keys is used to replace a single character with new text?
a. S
b. s
c. r
d. C
View Answer Report Discuss Too Difficult!
Answer: (b).s

8. Which command is used to extract specific columns from the file?
a. cat
b. cut
c. grep
d. paste
View Answer Report Discuss Too Difficult!
Answer: (b).cut

9. Which command sends the word count of the file infile to the newfile.
a. wc infile >newfile
b. wc <infile >newfile
c. wc infile - newfile
d. wc infile | newfile
View Answer Report Discuss Too Difficult!
Answer: (a).wc infile >newfile

10. 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 note
View Answer Report Discuss Too Difficult!
Answer: (d).chmod go-r note

Page 1 of 17