How to Use TCPdump?

TCPdump is a powerful command-line tool used to capture and analyze network traffic in real time. For anyone working in networking, security, or system administration, knowing how to use it is an essential skill.

It allows you to monitor packets traveling through a network interface. Unlike graphical tools, it operates directly from the terminal, making it lightweight and ideal for servers without a desktop environment.

What Does TCPdump Do?

When you run it, it listens on a selected network interface and displays captured packets. This includes information such as:

  • Source and destination IP addresses
  • Ports
  • Protocol type (TCP, UDP, ICMP)
  • Packet flags

Because this tool works at the packet level, it is extremely useful for troubleshooting connectivity issues and analyzing suspicious activity.

Basic Command

A simple command looks like this:

tcpdump -i eth0

This captures traffic on the “eth0” interface. If you want more readable output, you can add:

tcpdump -i eth0 -n

The -n option prevents hostname resolution, making output faster and clearer.

Using Filters in TCPdump

One of the most powerful features of this command is filtering. Filters allow you to capture only relevant traffic.

For example:

  • Capture traffic from a specific host:
    tcpdump host 192.168.1.10
  • Capture traffic on port 80:
    tcpdump port 80
  • Capture only TCP packets:
    tcpdump tcp

These filters make it efficient and precise when diagnosing issues.

Saving Captured Traffic

It can also save captured packets to a file for later analysis:

tcpdump -w capture.pcap

The saved file can then be opened in tools like Wireshark for deeper inspection.

Why Learn It?

It gives you direct visibility into what is happening on your network. It helps identify:

  • Failed connections
  • Latency issues
  • Suspicious traffic
  • Misconfigured services

Because it is lightweight and widely available on Linux systems, it is often the first tool engineers use when debugging network problems.

Conclusion

The command may seem intimidating at first, but its basic commands are straightforward. Once you understand filtering and capture options, it becomes an indispensable troubleshooting tool.

If you want deeper insight into network communication, learning the tool is a smart investment.

cURL Command Explained

The cURL command is one of the most versatile tools for transferring data between systems using URLs, and it has become a must-know utility for developers and system administrators alike. Whether you are testing APIs, debugging network issues, or automating requests in scripts, understanding how this command works can significantly improve your workflow.

At its core, the cURL command (short for “Client URL”) allows you to send HTTP, HTTPS, FTP, and other protocol requests directly from your terminal. It acts as a lightweight client that communicates with servers and returns responses in real time. Because of its flexibility and wide protocol support, it is commonly used in development, DevOps, and infrastructure environments.

Basic cURL Command Syntax

The most basic command looks like this:

curl https://example.com

This simple request fetches the content of a webpage and prints the response to your terminal. However, the real power of the cURL command comes from its many options and flags.

For example:

  • -X specifies the HTTP method (GET, POST, PUT, DELETE).
  • -H allows you to send custom headers.
  • -d sends data in POST requests.
  • -I fetches only the response headers.

By combining these options, you can fully simulate browser or API requests directly from the command line.

Using cURL Command for API Testing

One of the most common use cases for the command is API testing. Developers often use it to send POST requests with JSON payloads:

curl -X POST https://api.example.com -H “Content-Type: application/json” -d ‘{“name”:”Toby”}’

This makes the cURL command an excellent tool for verifying endpoints, testing authentication tokens, and debugging server responses without relying on external software.

Authentication and Security

The command also supports various authentication methods, including basic auth, bearer tokens, and even client certificates. For example:

curl -u username:password https://example.com

Because it supports HTTPS and encrypted connections, the cURL command is safe for transmitting sensitive data when configured properly.

Why It Matters

Understanding the cURL command gives you direct control over network requests. It helps you:

  • Debug server responses
  • Inspect HTTP headers
  • Automate backend tasks
  • Test web services quickly

Instead of guessing how a system behaves, you can use this command to see exactly what is being sent and received.

Conclusion

The cURL command may look simple at first glance, but it is one of the most powerful networking tools available on Linux, macOS, and even Windows. By mastering its syntax and options, you gain a reliable, scriptable way to interact with servers and APIs.

If you work with web technologies or infrastructure, learning the command is essential.