Strange question - Serial Number of USB key in Unix - ehMac.ca
Facebook
Twitter
YouTube
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
Old Sep 16th, 2010, 11:11 PM   #1
Honourable Citizen
 
cap10subtext's Avatar
 
Join Date: Oct 2005
Location: Toronto
Posts: 2,537
Strange question - Serial Number of USB key in Unix

Does anyone know how I get the serial number off a USB key a unix command (or commands) in terminal?

I can see it plain as day in the System profiler, but a google search turns up nothing useful.

Thanks.
cap10subtext is offline   Reply With Quote
Sponsored Links
Advertisement
 
Old Sep 17th, 2010, 08:03 AM   #2
Frequently Befuddled
 
Stephanie's Avatar
 
Join Date: Jul 2004
Location: Brampton
Posts: 837
The system profiler can be called from the command line:
system_profiler | more

That will give you all the same info. If you want to just extract the serial number of a particular device out, you could use a combination of other standard commands like grep or awk to filter it down to what you want.

Do a "man system_profiler" for more info on the command line version of it.

Edited to add:

Here's an example of a one-line unix command that finds the serial number of my USB hard drive enclosure:
system_profiler | grep -A 10 "Product ID: 0x2329" | grep "Serial Number"

It returns:
Serial Number: 9545FFFFFFFF

In this case, I know the product ID of the usb enclosure, "0x2329". You can find the product ID of your USB key in system profiler and then just use that in the unix command. You could also use the vendor id, or product name, or whatever other common identifier you wanted to grab onto.
__________________
She who laughs last -- probably made a back-up.
Stephanie is offline   Reply With Quote
Old Sep 17th, 2010, 08:07 AM   #3
Full Citizen
 
Join Date: Jul 2004
Location: Oakville, ON
Posts: 365
A Terminal command appears to give what you're after:

Code:
system_profiler SPUSBDataType
The relevant bits for my disk are:

Code:
        USB DISK:

          Capacity: 1.86 GB
          Removable Media: Yes
          Detachable Drive: Yes
          BSD Name: disk2
          Product ID: 0x1000
          Vendor ID: 0x090c  (Silicon Motion, Inc. - Taiwan)
          Version: 11.00
          Serial Number: AA08061700012275
          Speed: Up to 480 Mb/sec
          Manufacturer: SMI Corporation
          Location ID: 0xfd300000
          Current Available (mA): 500
          Current Required (mA): 100
          Mac OS 9 Drivers: No
          Partition Map Type: MBR (Master Boot Record)
          S.M.A.R.T. status: Not Supported
          Volumes:
            ORACLE:
              Capacity: 1.86 GB
              Available: 314.5 MB
              Writable: Yes
              File System: MS-DOS FAT16
              BSD Name: disk2s1
              Mount Point: /Volumes/ORACLE
          Volumes:
            disk2s1:
              Capacity: 1.86 GB
              Available: 314.5 MB
              Writable: Yes
              File System: MS-DOS FAT16
Craig
WCraig is offline   Reply With Quote
Old Sep 17th, 2010, 10:05 PM   #4
Honourable Citizen
 
cap10subtext's Avatar
 
Join Date: Oct 2005
Location: Toronto
Posts: 2,537
Thanks for the replies, will try this out.
cap10subtext is offline   Reply With Quote
Old Sep 26th, 2010, 03:14 PM   #5
Honourable Citizen
 
cap10subtext's Avatar
 
Join Date: Oct 2005
Location: Toronto
Posts: 2,537
@Stephanie and WCraig:
This nailed it, thanks so much for your help, it's exactly what I needed! Thank you! Thank you! Thank you!

Quote:
system_profiler SPUSBDataType | grep -A 10 "Product ID: XxXXXX" | grep "Serial Number"
And of course replacing XxXXXX with the ID of the key...
cap10subtext is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Serial Number jaws01 Mac, iPhone, iPad and iPod Help & Troubleshooting 8 Dec 5th, 2008 11:33 PM
Serial number accuracy "issue" yousef Mac, iPhone, iPad and iPod Help & Troubleshooting 4 Nov 28th, 2006 02:13 PM
OK to give out serial number? moof Anything Mac 4 Feb 19th, 2004 06:31 PM
USB Question monokitty Mac, iPhone, iPad and iPod Help & Troubleshooting 4 Nov 4th, 2003 11:40 AM
USB 2 Question? SOLID Anything Mac 2 Jan 31st, 2003 10:50 AM


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



Copyright © 1999 - 2012, ehMac.ca All rights reserved. ehMac is not affiliated with Apple Inc. Mac, iPod, iTunes, iPhone, Apple TV are trademarks of Apple Inc. Content Relevant URLs by vBSEO 3.6.0 RC 2

Tribe.ca: Urban living in Toronto!