UNIX Chapter 3

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

In command mode in the vi editor, which of the following symbols moves the cursor to the end of the current line?

$

You have just entered four lines of text in the vi editor. Use the repeat command to copy the four lines of text to the current location.

.

Search for the string UNIX in the vi editor

/UNIX

Which of the following binary digits represent the state of "off"?

0

Assume that you are in command mode. Provide the following vi editor command sequence: 1) enter the go to command to move to the beginning of the first line 2) move forward one word 3) delete the current word

1G w dw

You are working on a file that is a program that you have a printout of the file in front of you. From the printout, you realize that you need to correct a programming error on line 242. What command can you use to go directly to this line in the vi editor?

242G

Identify the go to command to go to the beginning of the second line in the vi editor.

2G

Assume that you are at the beginning of the first line in the vi editor. Cut the first three lines from the document and store them in the buffer.

3dd

Identify the go to command to go to the beginning of the fifth line in the vi editor.

5G

Assume you are in the command mode. Provide the following vi editor command sequence: 1) go to the fifth line 2) switch to insert mode 3) enter the string UNIX

5G i UNIX

Assume that you are in command mode. Provide the following vi editor command sequence: 1) move to the fifth line of text and 2) cut the entire line to place the text on the clipboard.

5G and dd

Leave vi temporarily to view the current month's calendar using the cal command.

:!cal

To leave vi temporarily to find the current date and time, you would perform which of the following operations in command mode?

:!date

Without exiting vi, temporarily execute the ls command to confirm that the file is saved.

:!ls

You are in the vie editor and realize that you need to perform a file listing to check the name of a file. What command can you use from vi?

:!ls

Use a single vi command to delete all lines from the current file.

:1,$d

In the vi editor, search for documents and replace it with text using a line-oriented command.

:1,$s/documents/text/g

Assume that you are in the vi editor, change the word tomorrow to today in the first five lines.

:1,5s/tomorrow/today/g

From the vi editor, use a single command to delete files from lines 5 through 7.

:5,7d

Use a single vi editor command to delete lines nine and ten from the current file.

:9,10d

From within the vi editor, view the vi help documentation

:help

Assume that you are viewing the help documentation from within the vi editor. Leave the documentation.

:q!

Sometimes, you make changes in a document, but then decide not to save them. Exit vi without saving your changes.

:q!

You are using vi to edit a configuration file, but decide to abort the editing session. What do you type from command mode?

:q!

Enter the vi editor command that causes line numbers to appear.

:set number

Save the work in your file without exiting the vi editor.

:w

To save a file and continue working in the vi editor, you would type which of the following?

:w

Which of the following commands save a file in vi and then exit?

:wq and :x

Assume that you are editing the file myfile in the vi editor. Save the file and exit vi.

:x

Save your work and exit the vi editor.

:x

Which of the following symbols precedes all line-oriented commands in the vi editor?

Colon (:)

Identify the key combination to view status information from your vi editing session.

Ctrl+g

Identify the key combination used in the vi editor to access the command line to execute several commands.

Ctrl+z

Identify the vi editor command to delete the text from the cursor to the end of the line.

D

Identify the command used to access command mode in vi.

Esc

True or False. In the vi editor, do you enter all screen-oriented commands on the status line?

False

True or False. Screen-oriented commands require you to specify an exact location or address for a particular operation.

False

True or False. The standard use of a string of 7 binary digits is called a byte.

False

True or False. The vi editor is often referred to as a(n) triad editor because it works in three modes.

False

True or False. To copy from the data file into the current file you are working on in vi, type :c data and press enter.

False

True or False. When you are in the insert mode in the vi editor, the pound # sign is used to invoke the repeat command.

False

True or False. When you are in the vi editor, you might see lines that start with a tilde ~. These lines represent storage buffers and the text after the tilde is text you have copied into the buffer that can be later pasted into your document. When you close vi, the text in these storage buffers are not saved.

False

Identify the go to command to go to the beginning of the last line in the vi editor.

G

You open a large document in the vi editor and decide that you want to quickly place the cursor at the beginning of the last line. Which command mode option do you use?

G

Assume that the current file occupies a single screen in the vi editor. Move the cursor to the top of the screen in the vi editor.

H

Identify the single-letter command to move the cursor to the upper-left corner of the screen in the vi editor.

H

To move the cursor within command mode in the vi editor, typing which of the following moves the cursor to the upper-left corner of the screen?

H

In vi, you position the cursor on line 18 and then type 5dd. Next you move the cursor to the end of the file and press p. What does this do?

It cuts lines 18 through 22 and then pastes the contents of those lines at the end of the file.

To move the cursor within command mode in the vi editor, typing which of the following moves the cursor to the last line on the screen?

L

Which of the following types of commands in vi executes at the location of the cursor?

Screen-oriented commands

True of False. A(n) line editor lets you work with one line or a group of lines in a file.

True

True or False. A macro is a set of commands that automates a complex task consisting of multiple steps.

True

True or False. In the vi command mode, you can type dw to delete the current word to which the cursor is pointing.

True

True or False. When printing a file from within the vi editor, you can use the line print command: by typing !lpr and then typing the name of the file you want to print.

True

A bit is ____.

a binary digit

Which vi command repeats the last change?

a period (.)

Identify the vi editor command to go back one word.

b

Files that contain non-printable characters, such as machine instructions, are called ____ files.

binary

When you start the vi editor, you are automatically in ___ mode.

command

Which of the following is a process that is used to convert source code into an executable file?

compiling

Identify the vi editor command to cut the entire current line and store it on the clipboard.

dd

In the vi editor, the ____ command deletes the current line you are working on in its entirety.

dd

In vi, a screen-oriented command ____.

executes at the location of the cursor.

If you use the Ctrl+z option to access the command line of your shell from vi, which of the following shell commands returns you to your edit session?

fg

You have left the vi editor to access the command line to execute several commands. Return to the vi editor

fg

Identify the command used to access insert mode in vi.

i

In the vi-editor, commands that perform more than one action, such as searching and replacing, are referred to as ____ commands.

line-oriented

You have searched for the string cons and found the first occurrence in the vi editor. Move the cursor to the next occurrence of cons.

n

From the vi editor, paste the lines on the clipboard into the document.

p

Undo your most recent change in the vi editor.

u

Start the vi editor and begin editing a file called newfile

vi newfile

Identify the vi editor command used to go forward one word.

w

Identify the vi editor command to delete the current character.

x

You can use which of the following commands in vi to copy a specific number of lines from a file and paste them onto the clipboard?

yy


Kaugnay na mga set ng pag-aaral

Consumer Behavior: Chapter 7 Review

View Set

AP Gov, Chapter 1, Test Bank Questions

View Set

Descubre 1 Lección 7 Estructura 7.1 p236-237 Reflexive verbs

View Set

algebra 2b - unit 1: exponential and logarithmic functions, part 1

View Set