I want to see how many interfaces(ethernet cards) are
working using single command?
Answers were Sorted based on User's Feedback
Answer / viren
lspci -n | grep 200
class 200 is the address of ethernet adapter
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / alf55
The command:
ifconfig -a | (grep -E 'Link encap:|inet6 addr|inet addr:' |
grep -vE 'inet addr:|inet6 addr')
Would result with an output similar to:
eth0 Link encap:Ethernet HWaddr 00:90:f5:b7:6a:1c
lo Link encap:Local Loopback
sit0 Link encap:IPv6-in-IPv4
wlan0 Link encap:Ethernet HWaddr 00:24:d7:a7:16:c0
So the command:
ifconfig -a | (grep -E 'Link encap:|inet6 addr|inet addr:' |
grep -vE 'inet addr:|inet6 addr') | wc -l
would produce the count.
The problem here is that it would also count usages such as
"eth0:0".
To not count those devices use:
ifconfig -a | (grep -E 'Link encap:|inet6 addr|inet addr:' |
grep -vE 'inet addr:|inet6 addr:|:[0-9][0-9]*') |wc -l
| Is This Answer Correct ? | 1 Yes | 0 No |
What does umask 077 mean?
How do I check memory usage on linux?
Which command is used to clear the screen?
You are required to restore the file memo.ben. It was backed up in the tar file MyBackup.tar. Which command would you use to do it?
What is clang format?
what is first RHEL 5.x version support ext4 filesystem?
What does cd – command do?
Which command is used to review boot messages?
How would you check the available disk space on a Linux system?
What is the gcc command?
Hi everyone i want to learn Devops in Hyderabad can anyone please suggest me best institute.
Write a command to find all of the files which have been accessed within the last 30 days.