Red Hat Section 5.7 Lab: Create, View and Edit Text Files

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

fourteenth step: Confirm that the directory listing is at the bottom of the lab file. Use the lab_file shell variable.

$ cat $lab_file

fifteenth step: grade and finish

$ lab grade edit-review $ lab finish edit-review

first step: start lab

$ lab start edit-review

second step: On workstation, create the lab_file shell variable and assign editing_final_lab.txt as the value. List the student home directory, including hidden directories and files, and redirect the output to the editing_final_lab.txt file by using the shell variable.

$ lab_file=editing_final_lab.txt $ ls -al > $lab_file

thirteenth step: List the content of the Documents directory, and append the output to the editing_final_lab.txt file, and display the output in the terminal. Use the tee command and the lab_file shell variable.

$ ls Documents/ | tee -a $lab_file

third step: Use Vim to edit the editing_final_lab.txt file. Use the lab_file shell variable.

$ vim $lab_file

fourth step: Enter the line-based visual mode of Vim. Your screen output might differ from these examples. Remove the first three lines of the editing_final_lab.txt file.

Enter the line-based visual mode with Shift+V. Move down by using the down arrow key twice to select the first three lines. Delete the lines by typing x.

ninth step: Enter the visual line mode of Vim and remove the rows that contain the Desktop and Public strings.

Use the arrow keys to position the cursor at any character on the Desktop row. Enter visual mode with uppercase V. The full line is selected. Delete the selection by typing x. Repeat the operation for the row with the Public string.

fifth step: Enter the visual mode of Vim. Remove the last seven characters from the first column on the first line. Preserve only the first four characters of the first column. Use the arrow keys to position the cursor at the last character of the first column on the first line. Delete the selection by typing x.

Use the arrow keys to position the cursor at the fifth character of the first column on the first line. Enter the visual mode by typing v.

sixth step: Enter the visual block mode of Vim. Repeat the operation of the previous step, but this time select from the second to the last line. Preserve only the first four characters of the first column.

Use the arrow keys to position the cursor at the fifth character of the second line. Enter the visual mode by using the Ctrl+V control sequence. Use the arrow keys to position the cursor at the last character of the first column on the last line. Delete the selection by typing x.

eighth step: Enter the visual block mode of Vim to remove the time column, to leave the month and day columns on all lines.

Use the arrow keys to position the cursor at the first character of the current seventh column. Enter the visual block mode by typing Ctrl+V. Use the arrow keys to position the cursor at the last character of the seventh column on the last row. Delete the selection by typing x.

seventh step: Enter the visual block mode of Vim and remove the fourth column of the file.

Use the arrow keys to position the cursor at the first character of the fourth column. Enter the visual block mode by using Ctrl+V. Use the arrow keys to position the cursor at the last character and row of the fourth column. Delete the selection by typing x.

eleventh step: Back up the editing_final_lab.txt file and append the date (in seconds) at the end of the file name preceded with an underscore (_) character. Use the lab_file shell variable.

cp $lab_file \ editing_final_lab_$(date +%s).txt

twelfth step: Append a dashed line to the editing_final_lab.txt file. The dashed line should contain 12 dash (-) characters for this lab to be graded correctly. Use the lab_file shell variable.

echo "------------" >> $lab_file

tenth step: Save your changes and exit the file.

enter the last-line :wq command.


संबंधित स्टडी सेट्स

Nurse's Tools: Professional Communication: Client Education

View Set

Chap 15 Review (Picture Questions)

View Set

Compensation and Benefits Chapter 10

View Set

Shooting skills and marksmanship

View Set

Chapter 22: An Age Of Nationalism and Realism, 1850-1871

View Set

Chapter 3: American Sign Language

View Set

1.2 Transporte de solutos a través de las membranas.

View Set