Questions - PDNA - Sequence - Lec 7
Questions - PDNA - Sequence - Lec 7
Multiple-Choice Questions:
1. What does the "wc" command do?
2. Which option prints the character counts using the "wc" command?
a) -m
b) -c
c) -l
d) -w
c) Compare the contents of two files and output the common entries
a) uniq
b) join
c) diff
d) cut
c) Compare the contents of two files and output the common entries
c) Compare the contents of two files and output the common entries
b) Redirected to a file
c) Discarded
10. Which symbol is used for redirecting the output of a command to a file?
a) >
b) |
c) <
d) &
11. What does the "-c" option do with the "uniq" command?
c) Compares the contents of two files and outputs the common entries
14. What is the purpose of using the "-v" option with the "grep" command?
15. The "sort" command outputs a sorted order of the file content based on a specified:
a) Sort key
b) Field delimiter
c) Line number
d) File size
16. Which option can be used with the "sort" command to sort numerically?
a) -n
b) -c
c) -r
d) -u
18. When redirecting the output of a command to a file using ">", if the file exists:
19. What does the "-f" option specify in the "cut" command?
a) Field specifier
b) File name
c) Field delimiter
d) File format
b) It compares the contents of two files and outputs the common entries
2. The "sort" command is used to remove duplicated lines from a file. (True/False)
4. The "join" command compares the contents of two files and outputs the differences. (True/False)
5. The "diff" command compares the contents of two files and displays the common entries.
(True/False)
6. The "sort" command outputs a sorted order of the file content based on a specified sort key.
(True/False)
7. The "grep" command extracts specific fields from a file. (True/False) cut
8. The "cut" command is used to search for the occurrence of a specific pattern in a file. (True/False)
9. By default, the standard output of any command will appear redirected to a file. (True/False)
10. The symbol ">" is used for redirecting the input of a command from a file. (True/False)
(note: The symbol ">" is used for redirecting the output of a command to a file, not for redirecting the
input of a command from a file.)
11. The "-c" option with the "uniq" command outputs each line with its number of repeats. (True/False)
13. The "-v" option with the "grep" command extracts lines that do not contain a specific pattern.
(True/False)
14. The "sort" command outputs the file content based on line numbers. (True/False)
15. The "-n" option with the "sort" command sorts the file content alphabetically. (True/False)
16. The "diff" command displays the common lines between two files by default. (True/False)
17. When redirecting the output of a command to a file using ">", if the file exists, the result will be
appended to the end of the file. (True/False)
(note: When redirecting the output of a command to a file using ">", if the file exists, the existing
content of the file will be overwritten with the new output which means its previous content will be
replaced entirely. If you want to append the output to the end of the file without overwriting the
existing content, you can use ">>" instead of ">" as the redirection operator.)
18. The "-f" option in the "cut" command specifies the field delimiter (True/False)
19. The "uniq" command removes duplicated lines based on consecutive entries. (True/False)
(note: The "uniq" command removes duplicated lines based on consecutive entries. It compares each
line of a sorted file with the line immediately preceding it, and if they are identical, it removes the
duplicate line. It only considers consecutive duplicate entries and does not remove duplicates that are
not adjacent to each other.)
يقارن األمر كل سطر في الملف المرتب مع السطر الذي." يزيل التكرار إذا كان السطرين المتتاليين في الملف نفسهماuniq" األمر
يعتبر األمر فقط التكرارات المتتالية وال يزيل التكرارات التي ليست مجاورة. يتم إزالة السطر المكرر، وإذا كانا متطابقين،يليه مباشرة
.لبعضها البعض
20. The "grep" command compares the contents of two files and outputs the common entries.
(True/False)