Computer Science, asked by sjeetendrakuma6532, 1 year ago

Write a command to redirect the lines which contains the word "birbal" from the file "sample.Txt" to the file "redirlines.Txt".

Answers

Answered by bhosalevishal793
84

Answer:

grep "Birbal" sample.txt>redirlines.txt

Explanation:

> is used to redirect the lines from files sample.txt to redirlines.txt

Answered by mapooja789
0

Given : the lines which contains the word "birbal" from the file "sample.Txt" to the file "redirlines.Txt".

Answer:

There are the answer is "sample.txt" to the file "redirlines.Txt".

Explanation:

To Find - Write a command to redirect the lines are word "birbal" from the file "sample.Txt" is to the file "redirlines.Txt".

write a command lines move to the file than,

"sample.txt" that include in the word "Birbal" to

the file "redirlines.txt."

grep creates desired file2 but doesn't modify file1 because

grep 'bar' file1 > file2

sed -i modifies desired file1 but don't create to file2

sed -i '/bar/d' file1

out of curiosity and to make a script more brief, an one line command to redirect the lines which contains.

#SPJ2

Similar questions