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 MCQs Filters and Regular Expressions

CSE105 — Creative Engineering Workshop 60 questions. Pick an option to check it.

Read the notes Subjective questions

0 of 60 answered 0 right 0 wrong , 60 left

  1. Question 1 of 60 grep and Extended grep Easy

    What does the grep command primarily do?

  2. Question 2 of 60 grep and Extended grep Easy

    Which option makes grep perform a case-insensitive search?

  3. Question 3 of 60 grep and Extended grep Easy

    Which command is equivalent to grep -E for extended regular expressions?

  4. Question 4 of 60 grep and Extended grep Easy

    Which grep option displays the line numbers of matching lines?

  5. Question 5 of 60 cut Easy

    Which cut option is used to specify fields to extract?

  6. Question 6 of 60 cut Easy

    In the cut command, what does the -d option specify?

  7. Question 7 of 60 head Easy

    By default, how many lines does the head command display?

  8. Question 8 of 60 head Easy

    Which command would you use to view the beginning of a file?

  9. Question 9 of 60 tail Easy

    Which command displays the last lines of a file?

  10. Question 10 of 60 tail Easy

    Which tail option follows a file and displays new lines as they are added?

  11. Question 11 of 60 sort Easy

    What is the default sorting order of the sort command?

  12. Question 12 of 60 sort Easy

    Which sort option performs a numeric sort instead of alphabetical?

  13. Question 13 of 60 sort Easy

    Which sort option reverses the sorting order?

  14. Question 14 of 60 wc Easy

    What does the wc command count by default?

  15. Question 15 of 60 wc Easy

    Which wc option displays only the number of lines?

  16. Question 16 of 60 tr Easy

    What is the main purpose of the tr command?

  17. Question 17 of 60 tr Easy

    Which tr command converts lowercase letters to uppercase?

  18. Question 18 of 60 uniq Easy

    What does the uniq command do?

  19. Question 19 of 60 Filters with Pipes Easy

    Which symbol is used to create a pipe between two commands?

  20. Question 20 of 60 Regular Expression Fundamentals Easy

    In a regular expression, what does the . (dot) metacharacter match?

  21. Question 21 of 60 grep and Extended grep Medium

    Which command lists all lines in data.txt that do not contain the word error?

  22. Question 22 of 60 grep and Extended grep Medium

    Which egrep (extended grep) command matches lines containing either cat or dog?

  23. Question 23 of 60 grep and Extended grep Medium

    What does grep -i 'linux' notes.txt do differently from grep 'linux' notes.txt?

  24. Question 24 of 60 cut Medium

    Given a file with comma-separated values, which command extracts only the 2nd field?

  25. Question 25 of 60 cut Medium

    What does cut -c 1-5 file.txt output?

  26. Question 26 of 60 head Medium

    Which command displays the first 3 lines of log.txt?

  27. Question 27 of 60 tail Medium

    Which command continuously monitors new lines appended to app.log in real time?

  28. Question 28 of 60 tail Medium

    What does tail -n +5 file.txt display?

  29. Question 29 of 60 sort Medium

    Which command sorts the numbers in nums.txt in numerical order rather than alphabetical order?

  30. Question 30 of 60 sort Medium

    What does sort -t ':' -k 3 -n /etc/passwd do?

  31. Question 31 of 60 wc Medium

    Which command counts only the number of lines in report.txt?

  32. Question 32 of 60 wc Medium

    A file contains 3 lines with a total of 12 words and 60 characters. What does wc file.txt print (in order)?

  33. Question 33 of 60 tr Medium

    Which command converts all lowercase letters in the input to uppercase?

  34. Question 34 of 60 tr Medium

    What does tr -s ' ' do to its input?

  35. Question 35 of 60 tr Medium

    Which command removes all digits (0–9) from the input stream?

  36. Question 36 of 60 uniq Medium

    Why does uniq file.txt sometimes fail to remove all duplicate lines?

  37. Question 37 of 60 uniq Medium

    Which command shows each unique line along with a count of how many times it occurred?

  38. Question 38 of 60 Filters with Pipes Medium

    What does the pipeline cat names.txt | sort | uniq | wc -l compute?

  39. Question 39 of 60 Filters with Pipes Medium

    Which pipeline outputs the 3 most frequently occurring words' counts from words.txt?

  40. Question 40 of 60 Regular Expression Fundamentals Medium

    In a regular expression, what does the pattern ^A match?

  41. Question 41 of 60 grep and Extended grep Hard

    Consider the file data.txt. Which command prints only lines containing a valid IPv4 octet range check for the first octet being 192 or 10, using extended regex anchored at line start?

  42. Question 42 of 60 grep and Extended grep Hard

    What does grep -Ec '^$' file.txt return?

  43. Question 43 of 60 Regular Expression Fundamentals Hard

    In a POSIX ERE, which pattern matches a string that is a sequence of one or more digits optionally followed by exactly one decimal part like .25?

  44. Question 44 of 60 cut Hard

    Given a line a:b::c:d, what does echo 'a:b::c:d' | cut -d: -f2,4 output?

  45. Question 45 of 60 cut Hard

    Which command extracts characters 3 through 6 (inclusive) from every line of file.txt?

  46. Question 46 of 60 sort Hard

    What is the effect of sort -t: -k3,3n -k1,1 /etc/passwd?

  47. Question 47 of 60 uniq Hard

    For a file where identical lines are scattered (not adjacent), which pipeline correctly counts each distinct line's total occurrences?

  48. Question 48 of 60 tr Hard

    What does echo 'HELLO world' | tr -s ' ' | tr 'A-Z' 'a-z' produce?

  49. Question 49 of 60 tr Hard

    Which command deletes all characters that are NOT digits from the input stream?

  50. Question 50 of 60 head Hard

    What does head -n -5 file.txt output on GNU coreutils?

  51. Question 51 of 60 tail Hard

    What is the difference between tail -n +10 file.txt and tail -n 10 file.txt?

  52. Question 52 of 60 wc Hard

    For a file ending without a trailing newline containing a\nb\nc (no newline after c), what does wc -l report?

  53. Question 53 of 60 Filters with Pipes Hard

    Which pipeline outputs the 3 most frequently occurring words (space-separated, one per line) in text.txt?

  54. Question 54 of 60 grep and Extended grep Hard

    What does grep -oE '[0-9]{1,3}(\.[0-9]{1,3}){3}' log.txt do?

  55. Question 55 of 60 Regular Expression Fundamentals Hard

    Which statement about the regex a.*b (greedy) matching the string axbxb is correct?

  56. Question 56 of 60 sort Hard

    Why might sort -n and sort (default) give different results for the lines 10, 2, 1?

  57. Question 57 of 60 uniq Hard

    What does sort file | uniq -u output?

  58. Question 58 of 60 cut Hard

    Given field1\tfield2\tfield3 (tab-separated), why does cut -d' ' -f2 file.txt fail to extract field2?

  59. Question 59 of 60 Filters with Pipes Hard

    A pipeline cmd1 | cmd2 | cmd3 returns a nonzero status. In a default bash shell (no pipefail), which command's exit status is used?

  60. Question 60 of 60 Regular Expression Fundamentals Hard

    In BRE (basic regular expressions used by default grep), which is the correct way to match one or more a characters?

That's unit 6

Answer a few questions and your score shows up here.