Question
Need help with this linux Operation System command. Module 9 Practical Application (28 points) Display the complete command that will accomplish the following actions. (ie.
Need help with this linux Operation System command.
Module 9 Practical Application (28 points)
Display the complete command that will accomplish the following actions. (ie. If you were asked which command would allow you to navigate to the /var directory you would display the following: cd /var (NOT just the command cd))
Vi Editor
1. Using the vi editor:
Create a document with four lines, each containing the word today.
What command would you use to copy the first four lines using only one command?
What command would you use to save the file, and exit vi? Reopen the document.
What command would you use to changetodaytoyesterday but only on the first four lines?
2. Using the vi editor:
Create a document called first.file, and enter a few lines of text in it. Save it.
Create a second document called second.file, and enter a few lines of text in it. Save it.
What commands would you use to create a third document called third.file by merging the text from the first two files? (3 pts)
3.Delete all text from third.file that you created using vi.
What command would you use to restore the data you just deleted?
4. Using the vi text editor create a file with 12 lines of text and on the fifth line insert your first and last name. What command would you use to go to the first line of the file?
What command would you use to search the file for your last name?
What command would you use to save the file, but not exit vi?
Without exiting vi, temporarily execute the ls command to confirm that the file is saved.
What command did you use temporarily leave vi (without exiting it) so you could execute t he ls command?
What command can you use that will cause line numbers to appear?
Scripting
5. Next, use the command to add your current working directory to the PATH variable. (2 points)
6. What command will create a variable called iam and assign the results of the whoami command to it?
7. Assign the variable t the value of 20. Next, assign the variable s the value of t+30. Finally, display the contents of t and s to verify you have correctly defined these variables. (4 points)
8. Create a script called lunch with a for loop that uses the variable sandwiches and then displays a line at a time the following sandwiches: chicken, ham, hummus, tomato. (5 points)
9. Someone wrote the following script but it doesnt work and youve been asked to troubleshoot it.
What is wrong with the following lines of code? (4 points)
While [ $value = 100 ; do ECHO Thats a large number. read value
fi
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started