Operating Environments - UNIX Ch3

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

A line editor lets you work with one line or a group or lines in a file.

True

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

True

In the vi command mode, you can type dw to delete the current word to which the cursor is pointing. 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

When printing a file 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

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

Save the file but do not exit vi.

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

:x

Save your work and exit the vi editor.

:x

Identify the single-letter command to move the cursor to the last line on the screen in the vi editor.

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

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

False

Identify the command used to access insert mode in vi.

i

Undo your most recent change in the vi editor.

u

In vi, a screen-oriented command _____.

executes at the location of the cursor

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

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 "go to" command to go to the beginning of the fifth line in the vi editor.

5G

Search for the string "UNIX" in the vi editor.

/UNIX

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

0

Which of the following commands save a file in vi and then exit? (Choose all that apply) - :wq - !r,quit - :x - #save

- :wq - :x

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. - Open vi, press the Insert key, and press Ctrl+Alt+h. - Open the vi editor with no file as the argument, because the documentation appears automatically.

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

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.

.

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

1G

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

You are in the vi 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

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

:5,7d

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!

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.

Blank #1) 1G Blank #2) w Blank #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.

Blank #1) 5G Blank #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.

Blank #1) 8G Blank #2) dd Blank #3) G Blank #4) p

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

Ctrl+g

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

D

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

Dollar sign ($)

Identify the command used to access command mode in vi.

Esc

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

False

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

False

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

False

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

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

G

You have just a few minutes until you need to be in a meeting. However, you want to quickly go to the end of the last line in a file you are editing in vi so that you can add several quick reminders about additional entries for the file when you resume your work on it. What command or command sequence goes right to the end of the file?

G and then $

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

Your new assistant is trying to use vi, but each time he tries to type a line of text, it is not entered on the screen. What is the problem?

He is not in insert mode.

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.

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

No

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.

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

Screen-oriented commands

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

Scripts

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

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

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

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

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

d0

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

Identify the vi editor command to delete the current word.

dw

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

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

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

US History "The Great Depression begins"

View Set

064 - Chapter 64 - The Changing Nature of Agriculture

View Set

what is an ecosystem? lesson 1 (environmental systems)

View Set

15.1 Introduction to Therapy and the Psychological Therapies

View Set

Cognitive Neuroscience Final Exam

View Set

Theology: Chapter 5 Celebrating Sacraments

View Set