Posts

Showing posts from February, 2023

SED : SED (Stream Editor) - Interview Question

Image
 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ SED (Stream Editor) is a powerful command-line utility in Linux used for performing various text manipulation tasks such as search and replace, filtering, and transformation. Here are some commonly used SED commands in Linux: cat -n filename  // displays output using line numbers Print a particular line multiple time. sed '2p' filename // This print 2nd lines along with other but 2nd line printed twice sed -n '16p' data.txt   // This print the 16th line alone $ sed -n '3{p;p;p}' data.txt Sreejith        7898980090      sreejith.sbk@gmail.com  London Sreejith        7898980090      sreejith.sbk@gmail.com  London Sreejith        7898980090      sreejith.sbk@gmail.com  London $ for ((i=...