# cf. Mac OS X: About This Mac window provides computer serial number, http://support.apple.com/kb/HT1529 # http://www.tuaw.com/2005/04/14/when-was-your-mac-born/ # http://www.chipmunk.nl/klantenservice/applemodel.html # sed will print & quit after the first match: ...p;q;}' man sed | less -p '\[1addr\]q' ioreg -c IOPlatformExpertDevice | grep IOPlatformSerialNumber | sed -n -e 'l' time -p /usr/sbin/ioreg -c IOPlatformExpertDevice | /usr/bin/sed -E -n -e '/IOPlatformSerialNumber/{s/^.* "IOPlatformSerialNumber" = "(.+)"$/\1/p;q;}' time -p /usr/sbin/system_profiler SPHardwareDataType | /usr/bin/awk '/Serial Number/ {print $3}' function serialnum() { /usr/sbin/ioreg -c IOPlatformExpertDevice | /usr/bin/sed -E -n -e '/IOPlatformSerialNumber/{s/^.*[[:space:]]"IOPlatformSerialNumber" = "(.+)"$/\1/p;q;}' return 0 } serialnum time -p serialnum
Never been to CodeSnippets before?
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
Get your Mac's serial number (See related posts)
You need to create an account or log in to post comments to this site.
Related Posts
» List the names & version num... in version shell osx mac bash unix sed list application mdfind lsregister number program mdls
» Remove leading zeros via par... in shell osx mac bash unix parameter remove number expansion zero leading trim
» ws - web search from the com... in shell osx mac search bash unix commandline web
» snippet in shell osx mac html bash unix commandline web download convert textutil ed snippet
» Switching firewall settings ... in shell osx mac bash unix ipfw firewall ruleset switch
» Delete WebKit search fields in shell osx mac bash unix safari webkit
Snippets (source code soon to be available) developed by Peter Cooper and powered by Ruby On Rails