Question: Unix question. How do I perform the following commands? TASK 1: Display all lines in famous.dat that end in 0 or 1, and have a

Unix question.

How do I perform the following commands?

TASK 1:

Display all lines in famous.dat that end in 0 or 1, and have a 1 in the 3rd from the last column. For example lines ending in 120 and 131 would be displayed.

TASK 2:

Create a one-line command, using he famous.dat file, to add the word " STREET" to the address, for all who live on 2nd or 3rd. For example: '2nd' becomes "2nd STREET" and '3rd' becomes "3rd STREET". Display only the first 9 lines.

Hint: use 2 sed statements with pipes.

Task 3

Display all lines in famous.dat that have only 4, 5, 6, 7 and 9 in the zip code. HINT: this is the same as NOT 0,1,2,3 or 8.

Task 4

Using only the grep command, search all files with names that end in either .html or .htm under the $HOME/public_html directory and display any lines that contain body tags (containing ''). No other output should be displayed even if there is no public_html directory. Hint: use two command arguments and 2>

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!