Hey guys,
I have a simple question. Is there a command that allows you to pull a certain line out of an input? Like if I wanted the 7th line from ifconfig. Is there a way to do this: ifconfig | [command] 7
?
Thanks!
Hey guys,
I have a simple question. Is there a command that allows you to pull a certain line out of an input? Like if I wanted the 7th line from ifconfig. Is there a way to do this: ifconfig | [command] 7
?
Thanks!
YOu can use sed to extract a particular line from a file and/or from standard in as follows
sed -n '7p' filename
or
some_command | sed -n '7p'