adplus-dvertising
frame-decoration

Question

Which of the following commands can be used to replace ‘professor’ with ‘director’ throughout the whole file?

a.

1,$s/professor/director/g

b.

%s/professor/director/g

c.

1,$s/professor/director

d.

1,$s/professor/director/g and %s/professor/director/g

Posted under UNIX

Answer: (d).1,$s/professor/director/g and %s/professor/director/g

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which of the following commands can be used to replace ‘professor’ with ‘director’ throughout the whole file?

Similar Questions

Discover Related MCQs

Q. Which of the following flag will be used for interactive substitution?

Q. Which one of the following commands will be used to delete all the instances of string ‘manager’ in file003?

Q. Which one of the following command is invalid?

Q. Search and replace operations can also use regular expressions for matching multiple patterns.

Q. For yanking text, ___ is used.

Q. For pasting text, ____ is used.

Q. c operator is used for changing the text.

Q. To change entire lines, ____ is used.

Q. Which operator is used in vi to filter text?

Q. To delete from current cursor upto the first occurrence of }, which of the following will be used?

Q. The command df. will _____

Q. To yank from current cursor up to first occurrence of string str in reverse direction, we can use:

Q. The following command will_________

!! tr ‘[a-z]’ ‘[A-Z]’

Q. The command c0 will change the text from current cursor to the end of line.

Q. For returning back to the original file after switching we can use:

Q. When multiple filenames are used with vi, we can switch to next file using ___ command.

Q. We can move back to the previous file using ____ command.

Q. :r !date inserts the output of date command in our file.

Q. To split the screen into multiple windows, we can use ____ command.

Q. To create a new window, ____ can be used.