unix3

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

Both vi and Emacs are examples of screen editors. True or False?

True

To enter vi and create a new file after the command prompt, you would type vi filename and press Enter.

True

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

1 1G 2 w 3 dw

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

1 5G 2 dd

Assume that you are in command mode. Provide the following vi editor command sequence: Blank # 1) go to the eighth line, Blank # 2) cut the entire eighth line, Blank # 3) go to the end of the file, and Blank # 4) paste it at the end of the file.

1 8G 2 dd 3 G 4 p

Identify the vi editor command used to copy the text from the file source.txt and put it in the current file.

:r source.txt

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

:set number

Line numbering can help you quickly identify specific lines that you want to edit in vi. Turn on line numbering.

:set number

Save the file but do not exit vi.

:w

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

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

:wq

Save your work and exit the vi editor.

:wq

Identify the command used to access insert mode in vi.

i

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

d$

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

false

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

false

Search for the text Linux in the vi editor.

/Linux

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

1: 5G 2: i 3: UNIX

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

False

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

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.

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

L

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

You have been editing a file in vi and decide to undo the most recent two actions you have entered. What should you type?

Press Esc, u, u.

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

True

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

You have placed the cursor in vi at the beginning of a line. While in the command mode, how can you delete the entire line?

Type dd.

How can you display the status line in vi?

Use the Ctrl+g command.

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

ctrl+g

Identify the vi editor command to delete the current word.

dw

Identify the command used to access command mode in vi.

esc

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 just searched for the string cons and found the first occurrence in the vi editor. Move the cursor to the next occurrence of cons.

n

In the vi editor, before you can enter text in a new file, do you have to use the i command?

yes

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

yy

Identify the vi editor command to delete the current character. (NOTE: It is not the Delete or Backspace keys.)

x

In command mode in the vi editor, to delete a character, move to that character and type which of the following?

x

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

5G

Assume that you are in the vi editor. Insert the contents of myfile into the current file.

:r myfile

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

0

Identify the repeat command to replicate the most recent changes you made to text in the vi editor.

.

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.

.

You are working on a file that is a program and 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

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

:!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

From the vi editor, use a single command to delete lines five through seven.

:5,7d

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. Assume that you have made a change to your document in the vi editor. Exit vi without saving your change.

:q!

You are using vi to edit a configuration file, but decide to abort the editing session (you haven't yet saved anything). What do you type from command mode?

:q!

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

Ctrl+z

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

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

Use the vi editor single-letter command to go to the first line displayed on the screen.

H

You are a newcomer to using vi and want to review its documentation before you edit a file. Which of the following are options in this situation? (Choose all that apply.)

Open vi, press Esc, type :!man vi, and press Enter. Type man vi at the command line before you open vi.

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

Screen-oriented commands

In the vi editor, are commands that can perform more than one action referred to as line-oriented commands?

Yes

A bit is _______________________.

a binary digit

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

binary

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

colon (:)

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

Delete the entire current line in the vi editor.

dd

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 your are working on in its entirety.

dd

Which of the following enables you to delete the current line in command mode of vi?

dd

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 your vi editing session.

fg

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

no

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

p

____________________ are files containing commands that are not typically compiled into machine code prior to running.

scripts

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

w

Open the file myfile in the vi editor.

vi myfile

Start the vi editor and begin editing a file called newfile.

vi newfile


Kaugnay na mga set ng pag-aaral

SPH-R388 Marketing Exam 1 Review

View Set

SQL performance interview questions.

View Set

PSYCH 210-Chp 14- Socioemotional Development in Middle Adulthood

View Set

Chemistry quiz 1 lesson 5.1 what is Chemistry

View Set

Music Final Flashcards FINAL VERSION

View Set

Trigonometry - Solving Basic Trig Equations by Factoring

View Set

Wellness Text 3- Oxygenation and Perfusion PrepU

View Set

Colorado Statutes, Rules and Regulations Common to All Lines

View Set