grep awk sort

grep awk sort

Print second column and sort
ifconfig -a | grep 192.168 | awk ‘{print $2}’ | sort

Print seconf column with extra text
 ifconfig -a | grep 192.168 | awk ‘{print “some text” $2 “more text”}’ | sort

Leave a Reply

Your email address will not be published. Required fields are marked *

four × 2 =

This site uses Akismet to reduce spam. Learn how your comment data is processed.