LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 01-05-2005, 05:46 AM   #1
sonika_singhi
Member
 
Registered: Oct 2004
Location: india
Distribution: fedora core
Posts: 34

Rep: Reputation: 15
Unhappy how to find MAC add of a machine?


hello
i need a command to know the hardware address of the machine.
ifconfig gives all the info
i want only mac address.
is there any structure to know this?
 
Old 01-05-2005, 05:55 AM   #2
masand
Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 57
how about

ifconfig eth0|grep HWaddr

do u want only the HWaddr as the O/P??

regards
 
Old 01-05-2005, 06:17 AM   #3
sonika_singhi
Member
 
Registered: Oct 2004
Location: india
Distribution: fedora core
Posts: 34

Original Poster
Rep: Reputation: 15
yes ,i want only hwaddr.i know i can do it using cut,but still..
any other option? i want to get hwaddr in a c prog.
 
Old 01-05-2005, 06:17 AM   #4
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 65
As root:[cide]ifconfig -a[/code]
 
Old 01-05-2005, 06:27 AM   #5
masand
Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 57
Quote:
Originally posted by rjlee
As root:[cide]ifconfig -a[/code]
how does this help to get the hwaddr pf a device ?

i get this from ifconfig man page
" if a single -a argument is given, it displays the status of all interfaces, even those that are down"

regards
 
Old 01-06-2005, 07:26 AM   #6
masand
Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 57
Quote:
Originally posted by sonika_singhi
yes ,i want only hwaddr.i know i can do it using cut,but still..
any other option? i want to get hwaddr in a c prog.
i am no prgramming expert but i found out these pages which might help to get ur MAC address in ur program

http://forums.devshed.com/archive/t-171811
and
http://sources.redhat.com/ml/cygwin/.../msg00922.html

regards
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
find IP from MAC mcirsta Linux - Networking 5 06-16-2009 03:06 PM
How to find an IP address from the MAC address of a remote machine ? jitz Linux - General 3 01-03-2006 07:55 AM
How to find IP address of a machine if I know their MAC Address dysenteryduke Linux - Networking 13 09-12-2005 10:21 AM
Could I add a cdrw to a 400mhz HP machine? silentwhispers Linux - Hardware 4 08-05-2004 02:01 AM
How to access MAC id of a machine in WAN set up thru router connected via ISDNline? Ramanathan Linux - Security 1 04-08-2004 02:20 AM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration