How to Identify Your Linux System: Desktop or Laptop

When using Linux, you may want to know if your system is a desktop or a laptop, as this information can help you understand the hardware capabilities and how to optimize your system.

In this article, we’ll explore a few simple commands that can help you determine whether your Linux system is a desktop or a laptop.

1. Using hostnamectl Command

The hostnamectl command provides a simple way to check the chassis type of your system.

hostnamectl
Check Chassis Type in Linux
Check Chassis Type in Linux

In the output, look for the line that starts with Chassis. If it says laptop, then your system is a laptop. If it says desktop, then your system is a desktop.

Following are a few Chassis types:

  • desktop: Indicates a desktop computer.
  • laptop: Indicates a laptop computer.
  • tablet: Indicates a tablet device.
  • server: Indicates a server.
  • other: Indicates any other type that doesn’t fall into the above categories.

2. Using dmidecode Command

The dmidecode command is useful for getting detailed hardware information.

sudo dmidecode -t system

In the output, look for the Product Name or Family. If it includes terms like XPS, ThinkPad, or any brand that typically represents laptops, it indicates that your system is a laptop. For desktop systems, you might see names like OptiPlex, Precision, or Inspiron without a numerical model indicating a portable nature.

Alternatively, you can use chassis-type option of dmidecode to display the computer hardware information.

sudo dmidecode -s chassis-type
Check Linux System Hardware Info
Check Linux System Hardware Info

3. Using upower Command

The upower command can give information about power devices connected to your system. If the system is a laptop, it should have a battery listed.

upower -e

If you see a battery device, your system is most likely a laptop. If there are no battery devices listed, you likely have a desktop system.

Check System Power Device Info
Check System Power Device Info
Summary

To summarize, you can easily check if your Linux system is a desktop or a laptop by using the following commands:

  • hostnamectl: Check the chassis type.
  • dmidecode: Retrieve detailed hardware information to identify the product name.
  • upower: Look for a battery device to determine if it’s a laptop.

You can identify your system type using these simple commands and make informed decisions about software installation, system optimization, and usage.

Feel free to explore these commands on your Linux system, and you’ll gain a better understanding of your hardware!

Hey TecMint readers,

Exciting news! Every month, our top blog commenters will have the chance to win fantastic rewards, like free Linux eBooks such as RHCE, RHCSA, LFCS, Learn Linux, and Awk, each worth $20!

Learn more about the contest and stand a chance to win by sharing your thoughts below!

Ravi Saive
I am an experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

4 Comments

Leave a Reply
  1. “When using Linux, you may want to know if your system is a desktop or a laptop”
    Wouldn’t that be obvious just by looking at the system? After all, a full tower system sitting on your lap is kind of hard to miss. :-)

    What are you trying to say in the article? Are you trying to present some CLI commands?

    Reply
    • @dragonmouth,

      Haha, you’re absolutely right – it’s pretty clear when you’re looking at the system! The point in the article is more about using CLI commands to identify hardware details, which can be helpful in certain cases, like when you’re working remotely or troubleshooting multiple systems.

      Reply
      • @Nicu,

        That’s a great observation! Yes, the use case can indeed be when you have remote access to a computer. In such cases, you might need to manage or gather information about the system without physical access.

        Additionally, this approach is very useful for automation or scripting purposes when you want to use the info programmatically to streamline tasks, such as remote monitoring, system management, or automated updates.

        Let me know if you have any other thoughts or questions!

        Reply

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.