ip addr show | grep global | awk -F' ' '{print $2}' | awk -F'/' '{print $1}'
Expect wrote: » a really quick and dirty code, there are better ways than this but it works. ip addr show | grep global | awk -F' ' '{print $2}' | awk -F'/' '{print $1}'
ally_uk wrote: » The first thing is say if I have lot's of text on the screen from a command output How would I go about just printing the 1st line of output and nothing else?
head -n 1
awk 'NR==1 {print;exit}'
Using the cut utility I only want to display lo: my question is how the hell do you go about working out fields, rows, tables, sections when the formatting is off like that and how the hell do you know what to cut?