How do I display a list of all network cards under Linux operating systems?
You can use any one of the following command to list network cards installed under Linux operating systems. Please note that the ifconfig and ip commands will also display interfaces information about vpn, loopback, and other configured interfaces.
- lspci command : List all PCI devices.
- lshw command : List all hardware.
- dmidecode command : List all hardware data from BIOS.
- ifconfig command : Outdated network config utility.
- ip command : Recommended new network config utility.
lspci command
Type the following command:
# lspci | egrep -i --color 'network|ethernet'
Sample outputs:
09:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5761e Gigabit Ethernet PCIe (rev 10) 0c:00.0 Network controller: Intel Corporation Ultimate N WiFi Link 5300
lshw command
The lshw command can extract detailed information on the hardware configuration of the machine including network cards. Type the following command:
# lshw -class network
Sample outputs:
*-network DISABLED
description: Wireless interface
product: Ultimate N WiFi Link 5300
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:0c:00.0
logical name: wlan0
version: 00
serial: 00:21:6a:ca:9b:10
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=iwlwifi driverversion=3.2.0-0.bpo.1-amd64 firmware=8.83.5.1 build 33692 latency=0 link=no multicast=yes wireless=IEEE 802.11abgn
resources: irq:46 memory:f1ffe000-f1ffffff
*-network
description: Ethernet interface
product: NetXtreme BCM5761e Gigabit Ethernet PCIe
vendor: Broadcom Corporation
physical id: 0
bus info: pci@0000:09:00.0
logical name: eth0
version: 10
serial: b8:ac:6f:65:31:e5
size: 1GB/s
capacity: 1GB/s
width: 64 bits
clock: 33MHz
capabilities: pm vpd msi pciexpress bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=tg3 driverversion=3.121 duplex=full firmware=5761e-v3.71 ip=192.168.1.5 latency=0 link=yes multicast=yes port=twisted pair speed=1GB/s
resources: irq:48 memory:f1be0000-f1beffff memory:f1bf0000-f1bfffff
ifconfig and ip command
To see all configured network devices, enter:
# ifconfig -a
OR
# ip link show
OR
# ip a
Sample outputs:
1: lo:mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: mtu 1500 qdisc mq state UP qlen 1000 link/ether b8:ac:6f:65:31:e5 brd ff:ff:ff:ff:ff:ff inet 192.168.1.5/24 brd 192.168.1.255 scope global eth0 inet6 fe80::baac:6fff:fe65:31e5/64 scope link valid_lft forever preferred_lft forever 3: wlan0: mtu 1500 qdisc noop state DOWN qlen 1000 link/ether 00:21:6a:ca:9b:10 brd ff:ff:ff:ff:ff:ff 4: pan0: mtu 1500 qdisc noop state DOWN link/ether 92:0a:e7:31:e0:83 brd ff:ff:ff:ff:ff:ff 5: vmnet1: mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000 link/ether 00:50:56:c0:00:01 brd ff:ff:ff:ff:ff:ff inet 192.168.121.1/24 brd 192.168.121.255 scope global vmnet1 inet6 fe80::250:56ff:fec0:1/64 scope link valid_lft forever preferred_lft forever 6: vmnet8: mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000 link/ether 00:50:56:c0:00:08 brd ff:ff:ff:ff:ff:ff inet 192.168.179.1/24 brd 192.168.179.255 scope global vmnet8 inet6 fe80::250:56ff:fec0:8/64 scope link valid_lft forever preferred_lft forever
/proc/net/dev
The dev pseudo-file contains network device status information. This gives the number of received and sent packets, the number of errors and collisions and other basic statistics.
$ cat /proc/net/dev
Sample outputs:
Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
lo: 20097 179 0 0 0 0 0 0 20097 179 0 0 0 0 0 0
vmnet8: 0 0 0 0 0 0 0 0 0 33 0 0 0 0 0 0
pan0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
wlan0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
eth0: 592509534 623058 0 0 0 0 0 1053 122269656 401567 0 0 0 0 0 0
vmnet1: 0 0 0 0 0 0 0 0 0 34 0 0 0 0 0 0
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop














{ 16 comments… read them below or add one }
In which distro are you using the ip command? I’m trying it in Ubuntu and it seems to be a command to manipulate routing
Use
@Chex, thanks! On Ubuntu, I was getting an error trying to run ‘ip -a’, but your command worked — and it’s very useful info.
It was a typo on part.
However, ip link show should be used.
For wireless cards I find “iwconfig” useful. I used to have problems with a wireless adapter going offline, which I worked around with “iwconfig wlan0 power off” to turn off its power management feature.
It would be most useful to correlate the HW info to the logical device name, such as the Broadcom NIC is eth1.
Try ethtool or lspci it will map both along with driver name:
OR
Writing a shell script left as an exercise for the reader.
At any point is this site going to post anything that isn’t basic common knowledge to any linux users that isnt a complete noob?
Because if not, then I’m going to unsubscribe from your RSS feed.
@root,
I can not stop you or anyone else from unsubscribing to our RSS feed. The /faq/ section is for new users only so it has all sort of questions and answers. As you may have noticed that I’ve already started to display the difficulty level for each Q & A. I’m also working on rss feed for all three difficulties. So that users can only subscribe as follows:
This is going to take a little more time as need some sort of coding and modification on my part. Hope this helps.
[updated] Various aspects of nixCraft can be monitored with RSS feeds including ability to sort out feed – http://www.cyberciti.biz/nixcraft-rss-feed-syndication/
Hope this helps!
@root
I don’t suppose you have noticed that at least 99% of the worlds population are at least some variant of a linux ‘noob’. It would indeed be pointless to run a web site for just the 1% who are whizz kids as you would have very few visitors indeed.
Also, I believe it should be ‘to any linux user who isn’t’
Regards.
I’ve clearly lost the plot a little myself, ‘at least’ and ‘indeed’ twice in above comment. Have to stop taking these tablets.
In your scripts, the easiest way is to do something like this.
for x in `/sbin/ifconfig | grep Link | awk ‘{print $1}’ | sort | egrep -v ‘inet6|lo’`
do
echo $x
done
Or you can /sbin/ifconfig $x | grep to extract and read the data into a variable to work on later.
Here is a small code you can use in your scripts.
for x in `/sbin/ifconfig | grep Link | awk ‘{print $1}’ | sort | egrep -v ‘inet6|lo’`
do
echo $x
done
You can replace echo $x with
/sbin/ifconfig $x | grep (any property you are looking for) and read that into a variable.
I think some of the posts are not being accepted in the comments, Vivek. Not sure why. I thought first it was something in my browser.
I sure hope I didn’t have duplicates in the comments. :-)
We cache page for 15 minutes. So you will not see updates immediately.