Complex Command Lines (cont) Or we could do it all in one command: $ netstat -natp 2>/dev/null | grep ` ifconfig -a |grep 'inet addr'| head -1 | awk -F: '{print $2}' | awk '{print $1}'`:22 | wc -l 3