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 |
How do I find my user id in linux?
What is umask 000?
What is know about grep commands?
Write a command that will do the following: -look for all files in the current and subsequent directories with an extension c,v -strip the,v from the result (you can use sed command) -use the result and use a grep command to search for all occurrences of the word orange in the files.
What is bash command?
Who is unix command?
I want to kill zombie process, but with using kill 9 i cannot kill that process? can u tell other commands?
What does (cd dir && command) do?
What is a ulimit in unix?
How do I run a command in linux?
What are the basic commands in command prompt?
can some one tell me the steps(with commands) to create LVM in RHEL 5????