LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   displaying all network interface card in linux. (https://www.linuxquestions.org/questions/linux-newbie-8/displaying-all-network-interface-card-in-linux-872097/)

fredie_barron 03-31-2011 04:32 AM

displaying all network interface card in linux.
 
hello all,
i am new to redhat linux,how do i list all newly added network interface card.can someone kindly help me with this?

markush 03-31-2011 04:35 AM

Hello fredie barron, welcome to LQ,

Code:

lspci | grep -i ethernet
(executed as root) should do the job.

Markus

NM04 03-31-2011 04:40 AM

i think -- ifconfig -a will do the job as well.

markush 03-31-2011 04:45 AM

Quote:

Originally Posted by NM04 (Post 4309387)
i think -- ifconfig -a will do the job as well.

no, it will not since it shows only NICs which are up.

Markus

Didier Spaier 03-31-2011 05:05 AM

Quote:

Originally Posted by markush (Post 4309393)
no, it will not since it shows only NICs which are up.

Markus

No, it will show all NICS

markush 03-31-2011 05:17 AM

Quote:

Originally Posted by Didier Spaier (Post 4309418)
No, it will show all NICS

Code:

samsung:~# ifconfig
wlan0    Link encap:Ethernet  HWaddr f0:7b:cb:2e:cd:3e 
          inet addr:192.168.178.26  Bcast:192.168.178.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:812 errors:0 dropped:0 overruns:0 frame:0
          TX packets:899 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:607146 (592.9 KiB)  TX bytes:135860 (132.6 KiB)

samsung:~#

this laptop has an ethernet-adapter as well
Code:

samsung:~# lspci | grep -i ethernet
04:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8040 PCI-E Fast Ethernet Controller
samsung:~#

But please note that I'm not really sure if this depends on the distribution.

Markus

Didier Spaier 03-31-2011 05:30 AM

The OP wanted to see the network interfaces, not the (PCI) network devices. Admittedly both commands are useful though, in order to match devices <-> interfaces ;)

And 'ifconfig' shows all network interfaces - but only with the '-a' option.

Other than that, AFAIK both 'lspci' and 'ifconfig' commands are distribution-agnostics.

NM04 03-31-2011 05:40 AM

markhush,
it seems you did only ifconfig and not ifconfig -a. try ifconfig -a-- this will show all the NIC's.
In fact both the commands will work for this thread.

markush 03-31-2011 06:16 AM

Well :doh:,

I've to say sorry, you're both right, I didn't think about the "-a" option. Thanks for correcting me.

Markus

fredie_barron 03-31-2011 01:45 PM

thaks very much markush lspci | grep -i ethernet work find for me.


All times are GMT -5. The time now is 05:05 AM.