QuestionQuestion

Transcribed TextTranscribed Text

QUESTION 1 Complete the sed command line string that will delete line 7 through line 11 inclusively from the file called sedfile. sed '#,11d' sedfile What would you replace the # with to complete the sed command string above? (1 6 (l 7d 0 7 0 11 QUESTION 2 Complete the sed commmand string below. Create a sed command line string that will replace ALL the occurrences of X and x with s within the file called sedfile. sed 's/'####-/s/g' sedfile Replace the ti### with the correct answer. 0 [Xandx] n Xx n Xx ' 0 [Xx] QUESTION 3 Which sed command line string will delete any line that begins with the string 'directory' within the file called sedfile. 0 sed '/ dir/d' sedfile 0 sed '/" dir/d' sedfile 0 sed 's/" dir/d' sedfile 0 sed '/ directory /d' sedfile QUESTION 4 Take a look at the file called ~fveglian/dear.john. You want to replace the name "Mary" with "Sue" anywhere it appears on lines 2 through 7. The following command will replace all occurrences of "Mary" with "Sue" in lines 2 through 7? sed '2, 7s/Mary/Sue/g' dear.john n True n False QUESTION 5 Change directory to my home directory. Execute the following sed command string . sed '/A$/d' sedfile Will this command remove all of the blank lines from the output of the command? n Yes 0 No QUESTION 6 cd to my home directory. Consider the following sed command string . sed '3,$s/Hallowein/Halloween/' halloween Will the above command string replace ALL the occurences of Hallowein with Halloween from line 3 to the end of the file in the file called halloween? n Yes 0 No QUESTION 7 cd to my home directory. Execute the following sed command string . Is -1 1 sed '/Ad/d' What does the sed command string do? 0 Outputs the contents of the directory but, deletes all blank lines from the output. 0 Outputs the contents of the directory but, deletes all lines that contain filenames from the output. 0 Outputs the contents of the directory but, deletes all references to sub-directories from the output. O Outputs the contents of the directory. QUESTION 8 cd to my home directory. Will the following command generate a list of the group names only from the file called sortfile and display the list to the terminal? awk -F! 1 { print $3 }1 sortfile The group names are located in column three of the file. n Yes n No QUESTION 9 cd to my home directory. Commands such as awk, sort, grep and more, can be used as a filter. These commands are considered filters when used to the right of a pipe. Using awk and the sort command , construct a command string that will reference the file called sortfile and output ONLY the user names in reverse sorted arder. The user names are those found in column 1. Will the following command achieve the above result? awk -FI '{ print $1 } ' sortfile I sort -r n Yes (1 No QUESTION 10 cd to the ~fveglian/midterm directory. Using awk, generate an output that contains the file entry names and file type/permissions only of the file entries within the directory. Separate the file entry names and file type/permissions columns by a colon(:). The output should resemble the following : filename : permissions Replace the ## below to create a sed command string that will generate the output requested above . Is '##-a1w k '{ print $9 ":" $1 }' n -A 0 -F 0 -1 n -r

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

1. C
2. D...

By purchasing this solution you'll be able to access the following files:
Solution.txt.

$5.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available IT Audit and Security Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats