"tail -f" using "tcpdump -r"

5,648
tail -c +1 -f /Path/to/syscontection.pcap | tcpdump -l -r -
Share:
5,648

Related videos on Youtube

Abdennour TOUMI
Author by

Abdennour TOUMI

Instructor of Course Run Kubernetes on AWS with EKS. Certified: 🥇 CKA - Kuberntes administrator k8s 🥇 CKAD - Kuberntes App Dev k8s 🥇 AWS DevOps Engineer - Professional devops aws 🥇 Professional Cloud Architect - Google Cloud google-cloud-platform 🥇 AWS Solutions Architect - Professional architecture aws 🥇 Red HAT Certified in Ansible Automation ansible devops 🥇 Red HAT Certified in Openshift Administration ocp 🥇 Red HAT Certified in Openshift App Development ocp 🥇 Red HAT Certified Engineer redhat 🏅 AWS Solutions Architect - Associate architecture 🏅 AWS SysOps Administrator - Associate aws 🏅 AWS Developer - Associate aws 🏅 Linux Professional Institute (LPIC-1) linux 🏅 Professional ReactJS Developer (Udacity Nanadegreee) react frontend 🏅 Fullstack web Developer (Udacity Nanadegreee) python flaskrest Top 1 Stackoverflow reputation in my country Tunisia since 2017 Read more about me: in.abdennoor.com

Updated on September 18, 2022

Comments

  • Abdennour TOUMI
    Abdennour TOUMI over 1 year

    To display content of pcap file , we use :

    tcpdump -r /Path/to/syscontection.pcap;
    

    However, this command line does not follow the pcap file on realtime , like tail -f which follows a plain text .

    • Is there an option with tcpdump which acts like -f of tail ?

    OR

    • Is there an option with tail that can read pcap file?

    OR

    • Something else ?
    • Admin
      Admin over 7 years
      tcpdump acts exactly what you want when running with no parameters.
    • Admin
      Admin over 7 years
      This is not a duplicate question. He is asking about tcpdump's input not output.
  • Dipto
    Dipto about 3 years
    This will not work when we want to read from multiple files, what will be the solution for tcpdump -l -r file1,file2 e.g. ? tail -c +1 -f file1 -f file2 | tcpdump -l -r - will not work since tail will output some extra lines while tailing multiple files
  • drHogan
    drHogan about 3 years
    @Dipto I guess you could simply two or more of these pipe command lines in backround. ( tail -c +1 -f a.pcap | tcpdump -l -r - & tail -c +1 -f b.pcap | tcpdump -l -r - & )
  • Dipto
    Dipto about 3 years
    Thanks. But what I found is tcpdump -r /Path/to/pcap is able to follow the file in realtime as it is. May be OP is facing another problem superuser.com/questions/735017/…