In a bash
script, I'm using tools like conntrack
and tcpdump
to output results to a file, but wish to hide the standard message displayed on the first output line on the command line after executing the command/script.
message:
conntrack v1.0.0 (conntrack-tools): 6 flow entries have been shown.
After reading the bash
man page, I've tried things like:
conntrack -L|grep "dport=6439" &> /tmp/file
No matter what redirect option I try, the conntrack
message stating the number of flow entries is always displayed in the shell where I execute the script. Same thing goes for tcpdump
where it lists the capturing device and number of packets captured, etc.
Of course, I could add clear
after the conntrack
or tcpdump
commands to quickly hide the output, but that solution is ugly.
How can I hide these kinds of messages?
/dev/null
would probably be better/dev/null
wouldn't apply here because I want to redirect the standard output to file/tmp/file/