In Linux, Write a sed command that copied a file to standard output, removing al
ID: 3859059 • Letter: I
Question
In Linux, Write a sed command that copied a file to standard output, removing all lines that begin with the word Today.
2) Write a sed command that copied only those lines of a file that begin with the word Today to standard output.
3) Write a sed command that copies a file to standard output, removing all blank lines (i.e., lines with no characters on them).
4) Write a sed program named ins that copied a file to standard output,changing all occurences of cat to dog angd preceding each modified line with a line that says following line is modified:
5) How can you use sed to triple-space (i.e., add two blank lines after each line in) a file?
Note: Submit the screenshot of the all ques.
Explanation / Answer
1. sed -e '/^Today.*$/d' oldfilename > newfilename
2. sed -n '/^Today/p' oldfilename
3. sed '/^$/d' oldfilename > newfilename
4. $ cat ins
/cat/ i
s/cat/dog/g
5. sed -e 'G;G' oldfilename
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.