ABSTRACT

Nano

List ten commonly used text-editing operations you can do in Nano.

Run Nano on your Raspberry Pi system. Create and edit a block of text that you want to be the body of an email message explaining the basic capabilities of the Nano editor. This file should be at least one page (45 to 50 lines of text) long. Then save the file as nano_doc.txt. Insert the body of text you created in an email message and send it to yourself.

Log on to your Linux system and execute the Nano program on a new, blank file.

On the first line of the file, type your first and last name.

On the second line of the file, type "The Nano text editor allows

you to do simple editing on small text files efficiently" .

Use a Nano command to write the file to the default directory with the name lab51.

Print the file lab51 at your Raspberry Pi system line printer.

Do the following steps to create a file in Nano:

Step 1: At the shell prompt, type nano and then press <Enter>.

Step 2: In the text area of the Nano screen, place the cursor on the first line and type

This is text that I have entered on a line in the Nano editor.

Use the <Delete> and <arrow> keys to correct any typing errors you make.

Step 3: Press <Enter > three times.

Step 4: Type This is a line of text three lines down from the first line.

Step 5: Hold down the <Ctrl> and <O> keys at the same time (<Ctrl-O> or <^O>).

Step 6: At the prompt File Name to Write: type linespaced and then press <Enter>.

Step 7: Hold down the <Ctrl> and <X> keys at the same time

(<Ctrl-X> or <X>) to return to the shell prompt.

Step 8: At the shell prompt, type more linespaced and then press <Enter>.

Do the following steps in Nano:

Step 1: At the shell prompt, type nano linespaced and then press <Enter>. The linespaced file you created in Problem 1.4 appears in the Nano screen.

Step 2: Position the cursor at the beginning of the fourth line, at the character T in the word This, using the <arrow> keys on the keyboard.

Step 3: Hold down the <Ctrl> and both the <Shift> and <6> keys at the same time.

Step 4: Move the cursor with the <right arrow> key on the keyboard until you have highlighted the entire fourth line, including the period. The cursor should be one character to the right of the period at the end of the line.

Step 5: Hold down the <Ctrl> and <K> keys at the same time.

This action cuts the line of text out of the current “buffer,” or file that you are working on.

Step 6: Position the cursor with the <arrow> keys at the beginning of the second line of the file, directly under the line that reads This is text that I have entered on a line in the Nano editor.

Step 7: Hold down the <Ctrl> and <U> keys at the same time. This action pastes the former fourth line into the second line of the file.

Step 8: Use the <arrow> keys on the keyboard to position the cursor at the third line of the file.

Step 9: Hold down the <Ctrl> and <U> keys on the keyboard at the same time. This action pastes the former fourth line into the third line of the file.

Step 10: Now change the wording of lines 2 and 3 so that they read:

This is a line of text 1 line down from the first line.

This is a line of text 2 lines down from the first line.

How many lines are there in this file now, as far as Nano is concerned?

Step 11: Hold down the <Ctrl> and <O> keys at the same time.

Step 12: At the prompt File Name to Write: type linespaced2 and then press <Enter>.

Step 13: Hold down the <Ctrl> and <X> keys at the same time to return to the shell prompt.

Step 14: At the shell prompt, type more linespaced2 and then press <Enter>.

What do you see on screen? How many lines does the more command show in this file?

Complete Problem 1.5, use Nano to add two(2) more lines of text to the file named linespaced2 below lines 2 and 3, with similar content to lines 2 and 3. Then add a line at the top of the file with your first and last name on it. Save this new file with the name linespaced3 and print it at your Linux system line printer.

What version of Nano did you use in the above work, and how did you find this out?

Use the cat command to create a short text file named shorty on your Raspberry Pi system, and then read that file into Nano, and add text to it. What command did you use to read the cat-created file into Nano?

Execute Nano on your Raspberry Pi system using the –m command option. What functionality did the –m option give you in Nano?

Repeat Problems 1.4, 1.5, and 1.6 by launching Nano using the -m option on the command line. When would it not be possible to use Nano with the -m option?