Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

tshark and bash script to log network interfaces

Hello I am very new to bash scripting and I am currently looking to make a very basic bash script to log out data from my network interfaces using tshark and write to a file , with splitting the file after every 60 s. in a native linux system Also I wanted to log out multiple threads at the same time. What I wanted to achieve was to start logging of the different interfaces at the same time. I am not sure if t shark supports it . I tried the following commands

I am logging and writing out to file in the following order

sudo tshark -i ens33 -b duration:60 -w folder1/

Where I try to log in one folder . And to try with -t argument , I tried the following but it did not work

sudo tshark -i ens3s0f1 -b duration:60 -w folder1/ -i ens33 -b duration:60 -w folder2 /

so basically i have to execute the

sudo tshark -i ens33 -b duration:60 -w folder1/

sudo tshark -i ens3s0f1 -b duration:60 -w folder2/

In the bash script . Is it even possible to have tshark running in a bash script ?