[LINUX] I need the command for each of these steps. Make sure you write the comm
ID: 3718345 • Letter: #
Question
[LINUX]
I need the command for each of these steps. Make sure you write the command in bold.
Step 3: You can use the cat utility to create a file in your current directory. For example, "Hello World!", the content of MyFile, is created as follows:
$cat>MyFile
Hello World!
CTRL-D
Now you need to use the cat utility to create Sam's chapter files in your home directory from the information provided here:
Step 5: Create a file in your home directory named ChapterList that lists the names of the first three chapters in your home directory.
Step 7: To review how the chapters of Sam’s novel flow together, create a file named Novel that is a concatenation of the three chapter files. Display the contents of the Novel file on your screen to ensure that it successfully contains the text of all three chapters.
-----------------------------------------------------------
Step 3: Ensure that you have the Novel file, which was created in the previous assignments, in your home directory by listing the contents of the directory. Instruct the shell to open the Novel file so you can view the contents.
Step 4: Once you have viewed the contents of the file with the shell, open the Novel file with the visual editor using the vi or vim command. Do the contents of the file appear to be the same as when opened by the shell? Note your results in the answer sheet.
Step 5: Navigate through the Novel file by using the direction key that moves the cursor down one line at a time. Which two keys are available for moving down through the file one line at a time? Note your results in the answer sheet above.
Step 6: Navigate in each direction through the file by using all of the direction keys available to you. List the keys and their associated directions in the answer sheet above.
Step 7: Enter the command that instructs the visual editor to search through the Novel file, then locate and move the cursor to the word the. Once you have located the first occurrence of the word the, locate the next, and every other occurrence thereafter.
Step 8: Enter the command that instructs the visual editor to search through the Novel file, then locate and move the cursor to the word rush. Instruct the vi editor to delete the words rush to in the sentence. If the word rush is not found in the Novel file, use the visual editor to add it to the file and repeat step 8.
Step 9: Navigate to the first line of text in the Novel file. Instruct the editor to delete the entire line of text. Instruct the vi editor to undo the previous change to the line of text.
Step 10: Save your edits to the Novel file and quit the visual editor. Confirm that you have exited the visual editor by issuing the dir command to the shell. Open the Novel file with the shell and view the contents of the file. Have your edits been saved?
Step 11: Type exit at the command line to save the script file you
Step 12: Save your answers.pdf and then submit it on Canvas.
Step 13: Log off the terminal.
Chapter Title Text Chapter_1 It was a dark and stormy night. Christina unsuccessfully tried to block out the sounds of the thunderstorm. Chapter_2 Christina looked at her watch. He was late. Chapter_3 The sun was setting but Jake didn’t care.Explanation / Answer
cd ~
cat > Chapter_1
It was a dark and stormy night. Christina unsuccessfully tried to block out the sounds of the thunderstorm.
CTRL-D
cat > Chapter_2
Christina looked at her watch. He was late.
CTRL-D
cat > Chapter_3
The sun was setting but Jake didn’t care.
CTRL-D
#Below command is used to concanate the above three files, into Novel file
(cat Chapter_1; echo -e " "; cat Chapter_2 ; echo -e " "; cat Chapter_3) > Novel
#For the opening file in vi use following command
vi Novel
#For the existing press first Esc then (Shift + Colon(:)) + q! + Enter
#For Step-5 you can use Down Arrow key to move downward or by
#using 'j' key pressing
#For Step-6
# j or Down Arrow- move cursor down one line
#k or Up-Arrow - move cursor up one line
#h or left Arrow - move cursor left one character
# l or right Arrow - move curosr right one character
#Step-7
#For searching open vi then press forward slash(/) then enter the string, for an e.g. /the first locate the word 'the' in #the first line then press 'n' key for next occurrence of specified String
#Step-8
/rush
#rush word is not available, first, we need to enter at the end
vi Novel
#use j key for down character
#Press i
#enter the word rush
#For deleting the word use 'x' key, pressing x to delete the single character under cursor.
#Step-9
#for delete entire line you can press 'dd' i.e. pressing d key two times
#Press 'u' for undo
#For save and quit
press first Esc then (Shift + Colon(:)) + wq! + Enter
#For checking of existing from vi editor
dir
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.