Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9152323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:00:52+00:00 2026-06-17T12:00:52+00:00

Possible Duplicate: i need get a substring from a file shell script I need

  • 0

Possible Duplicate:
i need get a substring from a file shell script

I need a little help. I just have a file with contains a capture from command.

tcpdump -Xvv -n proto \tcp -c 10 > capture.txt 2>/dev/null

The result of the output capture.txt is some like this:

15:29:18.164566 IP (tos 0x0, ttl 1, id 2394, offset 0, flags [none], proto TCP (6), length 125)
    10.0.0.243.61908 > 10.0.0.184.80: Flags [S], cksum 0x3d53 (correct), seq 1831050442, win 8192, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
    0x0000:  4600 0024 0000 0000 0102 3ad3 0a00 0000  F..$......:.....
    0x0010:  e000 0001 9404 0000 1101 ebfe 0000 0000  ................
   ..............
15:29:18.164567 IP (tos 0x0, ttl 128, id 2394, offset 0, flags [none], proto TCP (6), length 125)
    10.0.0.184.80 > 10.0.0.243.61908: Flags [S.], cksum 0x135e (correct), seq 2906424792, ack 1831050443, win 5840, options [mss 1460,nop,nop,sackOK,nop,wscale 7], length 0
    0x0000:  4600 0024 0000 0000 0102 3ad3 0a00 0000  F..$......:.....
    0x0010:  e000 0001 9404 0000 1101 ebfe 0000 0000  ................
    0x0020:  0000 0000 0000 0000 2323 2332 2323
    0x0030:  0300 0000 0000 0000 0000 0000 0000       ..............
15:29:18.164569 IP (tos 0x0, ttl 1, id 2394, offset 0, flags [none], proto TCP (6), length 125)
    10.0.0.243.61908 > 10.0.0.184.80: Flags [S], cksum 0x3d53 (correct), seq 1831050442, win 8192, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
    0x0000:  4600 0024 0000 0000 0102 3ad3 0a00 0000  F..$......:.....
    0x0010:  e000 0001 9404 0000 1101 ebfe 0000 0000  ................
    0x0020:  0300 0000 0000 0000 0000 0000 0000       ..............

I’m trying to use a grep command : grep -A but I can’t make it work.

I need get the destination port locate after the ip destination address.

The output must be:

80

61908

80

Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:00:54+00:00Added an answer on June 17, 2026 at 12:00 pm

    This seems to work here.

    tcpdump -Xvv -i wlan1 -n -nn proto \TCP -c 10 > capture.txt
    
    sed -n 's/.*\.\(.*\): Flags.*/\1/p' capture.txt
    443
    35673
    443
    35071
    80
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How to get IMG tag code from HTML document? I need help
Possible Duplicate: Get all files from VSS for a given date? I need to
Possible Duplicate: format date from 14 aug to YYYYMMDD Hi I need to get
Possible Duplicate: php get microtime from date string For a specific purpose, I need
Possible Duplicate: Get the seventh digit from an integer I have an integer and
Possible Duplicate: I need a good way to get data from a thread to
Possible Duplicate: best way to get value from Collection by index Say I have
Possible Duplicate: How to get the location (src) of a javascript file? I have
Possible Duplicate: Get just the hour of day from DateTime using either 12 or
Possible Duplicate: Get column index from label in a data frame I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.