Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I detect the model of a computer, like Leveno or Sony?

Is there any program can do this, for both PC & Laptop?

(I just want to load a specific driver when the target model is detected.)

share|improve this question
@walOck, are you writing a shell script? A C program? An udev rule? – andcoz Dec 1 '11 at 11:49
@andcoz , yeah , a shell script – warl0ck Dec 1 '11 at 13:16
up vote 8 down vote accepted

On my system, this works:

$ sudo dmidecode --type 1 | grep 'Product Name'
    Product Name: Macmini4,1
share|improve this answer
Yeah , that's the right command , actually plus dmidecode -t BIOS | grep Vendor solved my problem .. thanks ! – warl0ck Dec 1 '11 at 13:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.