Lshw outputs to single line

I enter: sudo lshw -class disk.

It it overwrites the output on a single line. The output doesn’t scroll. (Like I see in debian for instance.)

I think I’ve seen this before, but, I don’t remember what I did to get to work.

I didn’t have that installed on my machine, but I think you’d be better using inxi instead? It’s part of the default installation and man inxi will reveal useful options.

However, having installed it from the repos, it appears to work fine in Konsole.

I used sudo pacman -Syu lshw to install it.

Results
sudo lshw -class disk
  *-disk
       description: ATA Disk
       product: V Series SATA SS
       physical id: 0.0.0
       bus info: scsi@0:0.0.0
       logical name: /dev/sda
       version: 130
       serial: 232111000210712
       size: 931GiB (1TB)
       capabilities: gpt-1.00 partitioned partitioned:gpt
       configuration: ansiversion=5 guid=00xxxxx1-9fxx-4xxx-8xx8-0cxxxxxxx96b logicalsectorsize=512 sectorsize=512

It’s funny… I tried and happens something like @drmacro says. I see passing fast the words PCI (sysfs), USB, SCSI but no output. Trying sudo lshw -class disk > test.txt the output file is cero bytes long. This is the result of sudo lshw -class disk -html:

Summary
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator"  content="lshw-B.02.20" />
<style type="text/css">
  .first {font-weight: bold; margin-left: none; padding-right: 1em;vertical-align: top; }
  .second {padding-left: 1em; width: 100%; vertical-align: center; }
  .id {font-family: monospace;}
  .indented {margin-left: 2em; border-left: dotted thin #dde; padding-bottom: 1em; }
  .node {border: solid thin #ffcc66; padding: 1em; background: #ffffcc; }
  .node-unclaimed {border: dotted thin #c3c3c3; padding: 1em; background: #fafafa; color: red; }
  .node-disabled {border: solid thin #f55; padding: 1em; background: #fee; color: gray; }
</style>
<title>c1</title>
</head>
<body>
<div class="indented">
<div class="indented">
</div>
<div class="indented">
<div class="indented">
</div>
<div class="indented">
</div>
</div>
<div class="indented">
<div class="indented">
</div>
<div class="indented">
</div>
<div class="indented">
</div>
<div class="indented">
</div>
</div>
<div class="indented">
<div class="indented">
<div class="indented">
</div>
<div class="indented">
<div class="indented">
</div>
<div class="indented">
</div>
<div class="indented">
</div>
<div class="indented">
</div>
</div>
</div>
<div class="indented">
</div>
<div class="indented">
<div class="indented">
<div class="indented">
<div class="indented">
</div>
</div>
</div>
</div>
<div class="indented">
<div class="indented">
</div>
<div class="indented">
</div>
<div class="indented">
</div>
<div class="indented">
</div>
</div>
<div class="indented">
</div>
<div class="indented">
<div class="indented">
</div>
</div>
<div class="indented">
<div class="indented">
<div class="indented">
<div class="indented">
</div>
</div>
</div>
</div>
<div class="indented">
</div>
<div class="indented">
<div class="indented">
</div>
<div class="indented">
</div>
<div class="indented">
</div>
<div class="indented">
</div>
<div class="indented">
</div>
<div class="indented">
</div>
<div class="indented">
</div>
<div class="indented">
</div>
<div class="indented">
</div>
</div>
<div class="indented">
</div>
<div class="indented">
</div>
</div>
</div>
<div class="indented">
</div>
<div class="indented">
</div>
<div class="indented">
</div>
<div class="indented">
</div>
</body>
</html>

Instead, other commands like sudo lshw -class storage show the expected results.

Running lshw -short or lshw -businfo there’s no data with “disk” in the class column.

Tested in an Almalinux 9 system, sudo lshw -class disk returns data as expected. lshw command version is B.02.19.2. Manjaro has B.02.20, but tryed downgrading lshw to B.02.19.2 and also no results.

I installed lshw from the official Manjaro repository:

pacman -Si lshw
Repository      : extra
Name            : lshw
Version         : B.02.20-1
Description     : A small tool to provide detailed information on the hardware configuration of the machine.
Architecture    : x86_64
URL             : https://ezix.org/project/wiki/HardwareLiSter
Licenses        : GPL
Groups          : None
Provides        : None
Depends On      : gcc-libs  hwdata
Optional Deps   : gtk3
Conflicts With  : None
Replaces        : None
Download Size   : 1638.54 KiB
Installed Size  : 8269.40 KiB
Packager        : Felix Yan <felixonmars@archlinux.org>
Build Date      : Tue 09 Jan 2024 17:57:56
Validated By    : MD5 Sum  SHA-256 Sum  Signature

Issuing the command sudo lshw -class disk resulted in an initial visual listing of hardware types on a single line, however the final output was as expected.

The OP doesn’t specify which Manjaro edition they are using. I tested using Konsole/Yakuake on Plasma; I suspect the behaviour might differ according to a given environment.

The syntax used by the OP seems consistent with lshw -h:

sudo lshw -h
Hardware Lister (lshw) - B.02.20
usage: lshw [-format] [-options ...]
       lshw -version

        -version        print program version (B.02.20)

format can be
        -html           output hardware tree as HTML
        -xml            output hardware tree as XML
        -json           output hardware tree as a JSON object
        -short          output hardware paths
        -businfo        output bus information
        -X              use graphical interface

options can be
        -class CLASS    only show a certain class of hardware
        -C CLASS        same as '-class CLASS'
        -c CLASS        same as '-class CLASS'
        -disable TEST   disable a test (like pci, isapnp, cpuid, etc.)
        -enable TEST    enable a test (like pci, isapnp, cpuid, etc.)
        -quiet          don't display status
        -sanitize       sanitize output (remove sensitive information like serial numbers, etc.)
        -numeric        output numeric IDs (for PCI, USB, etc.)
        -notime         exclude volatile attributes (timestamps) from output