Black Friday 2025 – NPI EA (cat = Baeldung on Linux)
announcement - icon

Yes, we're now running our Black Friday Sale. All Access and Pro are 33% off until 2nd December, 2025:

>> EXPLORE ACCESS NOW

Baeldung Pro – Linux – NPI EA (cat = Baeldung on Linux)
announcement - icon

Learn through the super-clean Baeldung Pro experience:

>> Membership and Baeldung Pro.

No ads, dark-mode and 6 months free of IntelliJ Idea Ultimate to start with.

Partner – Orkes – NPI EA (tag=Kubernetes)
announcement - icon

Modern software architecture is often broken. Slow delivery leads to missed opportunities, innovation is stalled due to architectural complexities, and engineering resources are exceedingly expensive.

Orkes is the leading workflow orchestration platform built to enable teams to transform the way they develop, connect, and deploy applications, microservices, AI agents, and more.

With Orkes Conductor managed through Orkes Cloud, developers can focus on building mission critical applications without worrying about infrastructure maintenance to meet goals and, simply put, taking new products live faster and reducing total cost of ownership.

Try a 14-Day Free Trial of Orkes Conductor today.

1. Introduction

It’s a good practice to verify that any newly installed hardware operates correctly. While there are many hardware modules in a computer, we’ll focus on the NIC (Network Interface Card).

In this tutorial, we’ll learn how to verify that the NIC has the correct network speed using two different ways: with standard Linux tools, and with the ethtool command.

2. Using Standard Linux Tools

We can check the speed of our NIC module by using the /sys pseudo-filesystem:

$ cat /sys/class/net/<interface>/speed

The advantage of this method is that we don’t need to install any external software tools.

Before we run the command, we need to know the network interface name. Two easy ways to find it are by using the ifconfig command or the ip command. Of course, we can always just list the interfaces within the /sys/class/net/ directory:

$ ls /sys/class/net
bond0  bonding_masters  dummy0  eth0  lo  sit0  tunl0

Once we know the network interface name, we can run the cat command on its speed file. For example, if the interface name is eth0, here’s the command to execute:

$ cat /sys/class/net/eth0/speed
100

The output is 100, which means that the speed of our networking interface is 100 Mbit/s.

3. Using the ethtool Command

Another way of checking the speed of our NIC is to use the ethtool command. ethtool is a useful utility to get the settings of the networking devices on a system.

As our main focus is the network speed, we’ll filter the ethtool output for the speed by using the grep command, for example:

$ sudo ethtool eth0 | grep Speed
Speed: 100Mb/s

The command above consists of multiple sub-commands. Let’s look at them in more detail:

  • sudo provides root access
  • ethtool is the main command
  • eth0 is the interface name
  • grep Speed filters the ethtool output through a | pipe for the actual speed

As a result, we’ve obtained the speed of our NIC in a readable form. Further, it matches the information we already have from /sys/class/net/.

4. Conclusion

In this article, we learned how to find the speed of our NIC. Firstly, we looked at the standard Linux tool, where we checked the /sys/class/net/<interface>/speed file. And secondly, we learned how to use the ethtool command to filter out the same speed information.