Results 1 to 4 of 4
Thread: Linux get last line of output
-
04-04-2008, 09:55 AM #1Web Hosting Master
- Join Date
- Jun 2006
- Posts
- 1,112
Linux get last line of output
Hi
What command could I use to get the last line of an output?
Heres why...
I use this command:
Code:netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1
Code:1 203.118.105.* 1 80.195.165.* 1 87.211.51.* 1 91.40.90.* 8 82.2.222.* 213
Thanks!
-
04-04-2008, 10:35 AM #2Disabled
- Join Date
- Apr 2005
- Location
- Cochin
- Posts
- 2,452
netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1 | tail -1
-
04-04-2008, 01:06 PM #3Web Hosting Master
- Join Date
- Jun 2006
- Posts
- 1,112
Thanks very much!
To be honest, I should of thought of that myself. "tail" is one of the very few commands(?) I know in Linux!
Again though, thanks alot
-
04-04-2008, 09:41 PM #4Disabled
- Join Date
- Apr 2005
- Location
- Cochin
- Posts
- 2,452