Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 6 subjective questions Filters and Regular Expressions

CSE105 — Creative Engineering Workshop 20 questions with model answers. Write yours first, then compare.

Read the notes Practice MCQs
  1. Question 1 of 20

    Define a filter in the context of Unix/Linux commands. Explain how filters process data and give three examples of commonly used filters.

  2. Question 2 of 20

    Explain the grep command with its syntax. Describe at least five important options of grep with examples.

  3. Question 3 of 20

    Distinguish between grep, egrep, and fgrep. When would you use Extended grep?

  4. Question 4 of 20

    Explain the cut command in detail. How can it be used to extract columns and character ranges from a file?

  5. Question 5 of 20

    Describe the head and tail commands. How can tail be used to monitor a growing log file in real time?

  6. Question 6 of 20

    Explain the sort command with its important options. Illustrate numeric, reverse, and field-based sorting with examples.

  7. Question 7 of 20

    Explain the wc command. How does it count lines, words, and characters? Provide examples of its usage in pipelines.

  8. Question 8 of 20

    Explain the tr command. Describe how it is used for translating, deleting, and squeezing characters with suitable examples.

  9. Question 9 of 20

    Explain the uniq command. Why is sort usually used before uniq? Describe its important options with examples.

  10. Question 10 of 20

    What is a pipe in Unix/Linux? Explain how filters can be combined using pipes to build powerful command pipelines with examples.

  11. Question 11 of 20

    Define a Regular Expression (regex). Explain the fundamental building blocks of regular expressions with examples.

  12. Question 12 of 20

    Explain the different anchors and quantifiers used in regular expressions with suitable examples.

  13. Question 13 of 20

    Compare Basic Regular Expressions (BRE) and Extended Regular Expressions (ERE). List the metacharacters that differ between them.

  14. Question 14 of 20

    Explain character classes in regular expressions. Describe POSIX character classes with examples.

  15. Question 15 of 20

    With the help of examples, explain how grep is used with regular expressions to solve real-world text searching problems.

  16. Question 16 of 20

    Write and explain shell command pipelines to perform the following tasks: (a) Display the top 3 users consuming the most disk space, (b) Count the number of unique words in a file, (c) List the 5 most frequently occurring lines in a log file.

  17. Question 17 of 20

    Explain the concept of standard input, standard output, and standard error streams. How do filters and pipes make use of these streams?

  18. Question 18 of 20

    Describe how the sort, uniq, and wc commands can be combined to generate a word frequency report from a text file. Explain each stage of the pipeline.

  19. Question 19 of 20

    Explain the role of escaping and the backslash (\) in regular expressions. Why is escaping important, and what happens when metacharacters are used as literals?

  20. Question 20 of 20

    A file students.txt contains records in the format RollNo:Name:Marks:Branch. Write and explain commands to: (a) Extract only names, (b) Display records sorted by marks in descending order, (c) Count students in the CSE branch.

That's unit 6

Long answers stick best when they're tested again soon. Run the MCQs on this unit, then come back to the questions you found hardest.