Home > Unix Programming > Quizzes > Unix Basics Practice Test: Unix Simple Filters
Unix Basics Practice Test: Unix Simple Filters
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 100% Most missed: “uniq command requires a sorted file as input.”
Quiz on filtering commands, sort command, unique and tr commands. Here are some examples of Unix simple filters: cat: This command concatenates files and prints them to standard output. It can also be used to create new files. grep: This command searches for a pattern in a file or files and prints the lines that match the pattern. head: This command prints the first few lines of a file. sort: This command sorts the lines of a file in alphabetical or numerical order. tail: This command prints the last few lines of a file. tr: This command translates, squeezes, and/or deletes characters... Show more
Unix Basics Practice Test: Unix Simple Filters
Time left 00:00
25 Questions

1. By default, sort command reorders lines in ASCII collating sequence.
2. pr command adds ____ lines of margin at the top and bottom.
3. Which command is used for preparing a file for printing?
4. Which symbol is used with the tail command to print the file from the selected line?
5. To check whether the file has actually been stored in the default order, we can use ____ option.
6. Which option is used with paste command for joining lines?
7. Which option is used with pr command to suppress the header and footers?
8. We cannot perform sorting on columns using sort command.
9. The sort order can be reversed using ___ option.
10. Which option is used with pr command to display output along with line numbers?
11. We can perform sorting on secondary key also using sort command.
12. Filter’s are a category of commands that take the advantage of shell redirection feature.
13. What is the default delimiter used by the cut command for cutting fields?
14. Which command is used for translating characters?
15. head -n 3 emp.lst | tr ‘[a-z]’ ‘[A-Z]’
Above command will change the case of text from lower to upper.
16. ____ option is used with the cut command for cutting fields.
17. Which option is used with uniq command for selecting non-repeated lines?
18. Which command is used for locating repeated and non-repeated lines?
19. Which option is used with tr command for deleting characters?
20. The output of the following command will be:
$ uniq foo1 foo2
21. To extract specific columns from a file, ____ command is used.
22. Which option is used when we’ve to sort files containing only numbers?
23. We can also use -n option with tail command.
24. uniq command requires a sorted file as input.
25. _____ option is used with paste command if we want to specify our own delimiter.