Linux - IO redirection - multichoice questions

Question 1

To allow the search pattern HELLO to match both hello and HELLO, you would use the grep command with which command line switch?

Question 2

Which of the following command lines would list all lines from /usr/share/dict/words which contain the text sun, preceded by their line number?

Question 3

Which of the following command lines would list every line which contains the text cdrom from the file README, along with two lines of context before and after the matching line?

Question 4

Which of the following command lines would list the names of files (and only the names of files) found underneath the /etc directory which contain the word network (i.e., the word networking would not count).

Question 5

The command echo file.1 file.2 will

Question 6

For the user elvis, with /home/elvis for a home directory, which of the following commands would succeed on a default Ubuntu Linux installation?

Question 7

Which of the following commands would successfully redirect the output of the cal command to the file lsout.txt?

Question 8

Given the file logs.txt. Which of the following commands may increase the size of the file (its total bytes)

Question 9

Given the file logs.txt. Which of the following commands will necessarily increase the size of the file (its total bytes)

Question 10

Which of the following command lines would list lines from the file /etc/group which contain the text elvis?

Question 11

Which of the following command lines would return the number of lines which contain the text freedom found in the file /usr/share/doc/redhat-release-5Server/GPL?

Question 12

To copy file1.txt to file2.txt, you could use

Question 13

What will be in out.txt?

ls nonexistentfile | grep "No such file" > out.txt