Quantcast
Viewing all articles
Browse latest Browse all 3

Answer by Praveen Kumar BS for how to keep only lines with specific word

Below command you can use Tested and worked fine

 awk '{for(i=1;i<=NF;i++) {if (($i == "word1") || ($i == "word2")) {print $0}}}'  filename

Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>