adplus-dvertising

Welcome to the Filters and Regular Expressions MCQs Page

Dive deep into the fascinating world of Filters and Regular Expressions with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Filters and Regular Expressions, a crucial aspect of UNIX. In this section, you will encounter a diverse range of MCQs that cover various aspects of Filters and Regular Expressions, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within UNIX.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Filters and Regular Expressions. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of UNIX.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Filters and Regular Expressions. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Filters and Regular Expressions MCQs | Page 14 of 18

Q131.
Consider the following commands.

$ sed -n ‘1,2p’ emp.lst
$ sed -n ‘3,$!p’ emp.lst

The output of both commands will be same.
Discuss
Answer: (a).True
Q132.
Which option is used with sed for using multiple instructions?
Discuss
Answer: (d).–f and -e
Q133.
____ option is used for taking instructions from a file.
Discuss
Answer: (a).-f
Q134.
sed can also perform the substitution.
Discuss
Answer: (a).True
Q135.
Which one of the following is the correct syntax for performing substitution using sed?
Discuss
Answer: (c).sed [address]s /expr1/ expr2/ flags
Q136.
Which one of the following command is used for replacing | with : globally?
Discuss
Answer: (c).sed ‘s/|/:/g’ emp.lst
Q137.
To replace the string ‘director’ in the first five lines of file emp.lst with ‘manager’ we can use _____
Discuss
Answer: (c).sed ‘1,5s/director/manager/’ emp.lst
Q138.
Which of the following characters are used with sed as anchoring characters?
Discuss
Answer: (d).$ and ^
Q139.
What will be the function of the following command?

$ sed ‘s/ *|/|/g’ emp.lst
Discuss
Answer: (c).compress multiple spaces
Q140.
Basic regular expressions are divided into ______ categories.

a.

1

b.

3

c.

2

d.

5

Discuss
Answer: (b).3

Suggested Topics

Are you eager to expand your knowledge beyond UNIX? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!