Forrest logo
back to the smartctl tool

smartctl:tldr:8c2ec

smartctl: Display device information.
$ sudo smartctl --info ${-dev-sdX}
try on your machine

The command sudo smartctl --info ${-dev-sdX} is used to retrieve information about a storage device (usually a hard drive or SSD) using the smartctl tool, with elevated privileges granted by sudo. Here is an explanation of each part of the command:

  • sudo: It is a command used in Unix-like operating systems to execute a command with administrative (root) privileges. By using sudo, it requests the user to enter their password and then runs the subsequent command with elevated privileges.

  • smartctl: It is a command-line utility used to monitor and control SMART (Self-Monitoring, Analysis, and Reporting Technology) data on storage devices. The smartctl tool allows you to read various attributes and statistics that can help analyze the health and performance of the storage device.

  • --info: This is an option/flag used with smartctl to specify that information about the specified device should be retrieved.

  • ${-dev-sdX}: This is the device identifier for the storage device you want to retrieve information about. In the command, sdX represents a placeholder where you need to substitute it with the actual device identifier (e.g., sda, sdb, nvme0n1, etc.). The ${-dev-sdX} is an example of variable substitution syntax commonly used in Unix-like systems, where -dev-sdX may be replaced with the actual device identifier like -dev-sda or -dev-nvme0n1.

To use the command, replace ${-dev-sdX} with the appropriate device identifier and execute it on the command line, preferably with administrative privileges. The output will provide you with various information about the specified storage device, such as its model, serial number, firmware version, capacity, temperature, and more.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the smartctl tool