
Complex Command Lines
Let's find how many SSH sessions to the local machine exist.
Find our own IP address:
$ ifconfig eth0 | head -2
eth0 Link encap:Ethernet HWaddr 00:10:F3:02:15:00
inet addr:192.168.1.200 Bcast:192.168.1.255
$ ifconfig -a | grep 'inet addr'| head -1 \
| awk -F: '{print $2}' | awk '{print $1}'
192.168.1.200
$ myip=`ifconfig -a | grep 'inet addr'| head -1 |
awk -F: '{print $2}' | awk '{print $1}' `
Copyright 2005, Bri Hatch of Onsight, Inc.
Presented at LFNW - LinuxFest Northwest, Bellingham, Washington, Apr 2005
Presentation created using vim and MagicPoint.