mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-01-26 11:33:59 +00:00
30 lines
596 B
Plaintext
30 lines
596 B
Plaintext
---
|
|
syntax: markdown
|
|
tags: [tldr, common]
|
|
source: https://github.com/tldr-pages/tldr.git
|
|
---
|
|
# ngrep
|
|
|
|
> Filter network traffic packets using `regex`.
|
|
> More information: <https://github.com/jpr5/ngrep/blob/master/EXAMPLES.md>.
|
|
|
|
- Capture traffic of all interfaces:
|
|
|
|
`ngrep -d any`
|
|
|
|
- Capture traffic of a specific interface:
|
|
|
|
`ngrep -d {{eth0}}`
|
|
|
|
- Capture traffic crossing port 22 of interface eth0:
|
|
|
|
`ngrep -d {{eth0}} port {{22}}`
|
|
|
|
- Capture traffic from or to a host:
|
|
|
|
`ngrep host {{www.example.com}}`
|
|
|
|
- Filter keyword 'User-Agent:' of interface eth0:
|
|
|
|
`ngrep -d {{eth0}} '{{User-Agent:}}'`
|