Here's the problem, I have a list generated by this command;
It generates output that looks like this (severely truncated for clarity)
There are hundreds of lines in the output, and what I'd like to do is suppress any output where the value in column 1 ("pkts") is zero. Row 2 column 1 of the data shows a value of zero, and these are the lines I'd like to delete. In other words, only see lines where there IS activity. (watch runs every 5 seconds to give something approaching a realtime output)
Much reading in these forums seems to indicate awk is the answer, but if I pipe the results of the above command through awk like this:
| awk '$1 == 0' #remove any rows where the value in column one is zero
there is no output of any kind, which isn't exactly useful
Could anyone point out what I'm doing wrong please?
Regards & TIA,
putter
Last edited by putter1900; 04-09-2012 at 07:15 AM..
ABSOLUTELY DEAD-ON!! Thanks so much for the clarification
Running either one against a static instance of iptables -nvl works like a charm, like this;
For some reason (probably, I suspect, syntax-related in some way) I can't combine that with "watch" to produce the functional equivalent of a "live output"....and that remains an obstacle.
MANY thanks for your help, greatly appreciated!
putter
Last edited by Scrutinizer; 04-09-2012 at 09:03 AM..
Reason: code tags
Hi all,
I started playing around with Python (2.6.6) trying to parse a file. No matter what I tried so far I am not able to print only the lines/group/backreference that have been affected by the substitution. Instead I get also the other lines too
File to parse:
some more text
... (2 Replies)
I have a file containing data in multiple columns. The colums are seperated by pipe (|). I need to extract information as below:
myfile_20130929_781;10;100.00
where myfile.txt is the file name. 10 is the number of records in the file starting with 120 and 100.00 is the sum of 26th field of... (16 Replies)
I have to stop the output of dd from writing to terminal. Here is the command:
sudo dd if=boot1h of="/dev/r$temp1"
Here is the output:
2+0 records in
2+0 records out
1024 bytes transferred in 0.000804 secs (1273715 bytes/sec)
I have tried >> log.txt but it doesn't work. Is there... (4 Replies)
Hi Guys,
I am calling a function from my script.
The function has to return only one value which is the year.
But in the function, i am having connecting statement to the database. The connection information is coming along with the year variable.
I want to suppress the connecting... (1 Reply)
hey i have piece of code working in solaris and same code i want to deploy it in linux but in solaris its not asking for queris but in linux it is !!!!
COMMAND ==>
unzip $test/alter.war -d $webclientHome/.
OUTPUT==>
In solaris it proceeds with following traces
replace /aa/test.txt?... (4 Replies)
Hello everyone,
Sorry if this is a bit of an RTM thing, but I can't find any flags for suppressing warnings with awk and Googling (this site too) didn't yield much useful. Does anyone know how to suppress warnings?
The warning I'm specifically trying to remove is one warning me that I'm... (1 Reply)