# #day10 Linux Advance

\[sed/grep/awk\]

To get file data which is having "INFO"

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681933313617/4f5d2286-3347-47b0-aadb-129fbb319576.png align="center")

Print the content of the log file

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681933402536/b41121d7-3b05-41c7-8066-cf149ce2aaa3.png align="center")

Print which written term "INFO"

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681933585753/8544fc79-b0b6-4663-97b4-8c1361fd80cf.png align="center")

With 1st,2nd,3rd rows of log\_file.txt

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681933763198/814f6a9c-d30e-4ad9-a017-656ec87a4a3e.png align="center")

Print no of rows by using NR

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681934023771/b32d196d-237e-4f1b-ab5f-8638e9d243da.png align="center")

To find errors in 50 lines only.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681934273815/3ba35829-6853-4f23-aa95-abe086b55f01.png align="center")

Copy contents of log\_file.txt to file.txt

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681934973867/58a502b3-d652-480c-b4a1-97f4554ad1cd.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681935178078/7757c8a9-d151-491c-b092-835cd3f3b9ef.png align="center")

Run multiple commands using &&

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681936667489/efc5ef3c-b15a-4267-8fca-81650be80c78.png align="center")

To search a particular string/word from the file using grep

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681937388354/206b8b7d-bae4-423d-bf04-37ff45ec8300.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681937470950/4257da23-b400-465c-8ce6-20a1f98617db.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681937495259/743798d8-142c-4f77-bd0b-8f268b24b67a.png align="center")
