<?xml version="1.0" encoding="utf-8" standalone="yes"?><feed xmlns="http://www.w3.org/2005/Atom" xml:base="https://foundata.com/" xml:lang="en"><title>Toolbox on foundata</title><id>https://foundata.com/en/tags/toolbox/feed-atom.xml</id><link rel="self" type="application/atom+xml" hreflang="en" href="https://foundata.com/en/tags/toolbox/feed-atom.xml" title="atom"/><link rel="alternate" type="text/html" hreflang="en" href="https://foundata.com/en/tags/toolbox/" title="html"/><link rel="alternate" type="application/rss+xml" hreflang="en" href="https://foundata.com/en/tags/toolbox/feed-rss.xml" title="rss"/><link rel="alternate" type="application/atom+xml" hreflang="de" href="https://foundata.com/de/tags/toolbox/feed-atom.xml" title="atom, Deutsch"/><link rel="alternate" type="text/html" hreflang="de" href="https://foundata.com/de/tags/toolbox/feed-atom.xml" title="html, Deutsch"/><link rel="alternate" type="application/rss+xml" hreflang="de" href="https://foundata.com/de/tags/toolbox/feed-atom.xml" title="rss, Deutsch"/><updated>2025-06-23T18:10:00Z</updated><author><name>foundata GmbH</name><email>webmaster@foundata.com</email><uri>https://foundata.com/</uri></author><rights>© 2023-2026, foundata GmbH (https://foundata.com)</rights><icon>https://foundata.com/images/feed-icon.67ff83c698af1511552374e80cf5f6ff26d497ef21f04186cf058859d535ca75.svg</icon><logo>https://foundata.com/images/feed-logo.9138f24a120dabc7e3d34003662131cc9c7f2ff153ec39d2f6dea3a48c35b4bf.svg</logo><entry><title type="html">System insights with command-line tools: free and vmstat</title><id>tag:foundata.com,2025-06-23:/en/blog/2025/system-insights-command-line-free-vmstat/</id><published>2025-06-23T18:10:00Z</published><updated>2025-06-23T18:10:00Z</updated><link href="https://foundata.com/en/blog/2025/system-insights-command-line-free-vmstat/?utm_source=feed-atom" rel="alternate" type="text/html"/><link href="https://foundata.com/de/blog/2025/systemeinblicke-kommandozeile-free-vmstat/?utm_source=feed-atom" rel="alternate" type="text/html" hreflang="de"/><link href="https://foundata.com/en/blog/2025/fsfe-reuse-open-source-licensing-tips-tricks-spdx-sbom/?utm_source=feed-atom" rel="related" type="text/html" title="Making sense of software licensing with FSFE REUSE: A guide for open source developers, tips and tricks."/><link href="https://foundata.com/en/blog/2024/system-insights-command-line-lslogins-lsmod/?utm_source=feed-atom" rel="related" type="text/html" title="System insights with command-line tools: lslogins and lsmod"/><link href="https://foundata.com/en/blog/2024/system-insights-command-line-lsof-lsblk/?utm_source=feed-atom" rel="related" type="text/html" title="System insights with command-line tools: lsof and lsblk"/><link href="https://foundata.com/en/blog/2024/system-insights-command-line-lscpu-lsusb/?utm_source=feed-atom" rel="related" type="text/html" title="System insights with command-line tools: lscpu and lsusb"/><link href="https://foundata.com/en/blog/2024/system-insights-command-line-dmidecode-lspci/?utm_source=feed-atom" rel="related" type="text/html" title="System insights with command-line tools: dmidecode and lspci"/><author><name>Andreas Haerter</name><uri>https://andreashaerter.com/</uri></author><summary type="html">An article introducing the command line tools `free` and `vmstat`.</summary><content type="html" xml:base="https://foundata.com/"><![CDATA[<p><em>Note: This article was originally released <a href="https://fedoramagazine.org/system-insights-with-command-line-tools-free-and-vmstat/" target="_blank" rel="noreferrer noopener">in the Fedora Magazine</a>.</em></p>
<p>In this fifth article of the &ldquo;<a href="https://foundata.com/en/blog/2024/system-insights-command-line-lscpu-lsusb/">System</a> <a href="https://foundata.com/en/blog/2024/system-insights-command-line-dmidecode-lspci/">insights</a> <a href="https://foundata.com/en/blog/2024/system-insights-command-line-lsof-lsblk/">with</a> <a href="https://foundata.com/en/blog/2024/system-insights-command-line-lslogins-lsmod/">command-line tools</a>&rdquo; series we explore <code>free</code> and <code>vmstat</code>, two small utilities that reveal a surprising amount about your Linux system&rsquo;s health. <code>free</code> gives you an instant snapshot of how RAM and <a href="https://en.wikipedia.org/wiki/Memory_swapping" target="_blank" rel="noreferrer noopener">swap</a> are being used. <code>vmstat</code> (the virtual memory statistics reporter) reports a real-time view of memory, CPU, and I/O activity.</p>
<p>By the end of this article you will be able to translate buffers and cache into &ldquo;breathing room&rdquo;, read the mysterious available column with confidence, and spot memory leaks or I/O saturation.</p>
<h2 id="a-quick-tour-of-free" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#a-quick-tour-of-free" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="a-quick-tour-of-free">A quick tour of <code>free</code></a></h2><h3 id="basic-usage" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#basic-usage" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="basic-usage">Basic usage</a></h3><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ free -h
</span></span><span class="line"><span class="cl">       total    used    free   shared  buff/cache  available
</span></span><span class="line"><span class="cl">Mem:    23Gi    14Gi   575Mi    3,3Gi        12Gi      8,8Gi
</span></span><span class="line"><span class="cl">Swap:  8,0Gi   6,6Gi   1,4Gi
</span></span></code></pre></div><p><code>free</code> parses <code>/proc/meminfo</code> and prints totals for physical memory and swap, along with kernel buffers and cache. Use <code>-h</code> for human-readable units, <code>-s 1</code> to refresh every second, and <code>-c N</code> to stop after <code>N</code> samples which is handy to get a trend when doing something in parallel. For example, <code>free -s 60 -c 1440</code> gives a 24-hour CSV-friendly record without installing extra monitoring daemons.</p>
<p><strong>Free memory</strong> refers to RAM that is entirely unoccupied. It isn&rsquo;t being used by any process or for caching. On server systems, I tend to view this as wasted since unused memory isn&rsquo;t contributing to performance. Ideally, after a system has been running for some time, this number should remain low.</p>
<p><strong>Available memory</strong>, on the other hand, represents an estimate of how much memory can be used by new or running processes without resorting to swap. It includes free memory plus parts of the cache and buffers that the system can reclaim quickly if needed.</p>
<p>In essence, the distinction in Linux lies here: <em>free</em> memory is idle and unused, while <em>available</em> memory includes both truly free space and memory that can be readily freed up to keep the system responsive without swapping. <strong>It is not a problem to have a low free memory, available memory is usually what to be concerned about.</strong></p>
<p>A healthy system might even show <code>used</code> ≈ <code>total</code> yet <code>available</code> remains large; that mostly reflects cache at work. Your Linux kernel will automatically drop clean cache pages whenever an application needs the space, so cached memory is not wasted. Think of it as a working set that just hasn&rsquo;t been reassigned yet.</p>
<h3 id="spotting-problems-with-free" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#spotting-problems-with-free" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="spotting-problems-with-free">Spotting problems with <code>free</code></a></h3><ul>
<li><strong>Rapidly shrinking <code>available</code> combined with rising <code>swap used</code></strong> indicates real memory pressure.</li>
<li><strong>Large swap-in/out spikes</strong> point to thrashing workloads or runaway memory consumers.</li>
</ul>
<h2 id="vmstat--report-virtual-memory-statistics" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#vmstat--report-virtual-memory-statistics" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="vmstat--report-virtual-memory-statistics"><code>vmstat</code> – Report virtual memory statistics</a></h2><p><code>vmstat</code> (virtual memory statistics) displays processes, memory, paging, block-I/O, interrupts, context switches, and CPU utilization in a single line. Run it with an interval and count to watch trends (output shown below has been split into three sections for better readability):</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ vmstat <span class="m">1</span> <span class="m">3</span>
</span></span><span class="line"><span class="cl">procs -----------memory----------
</span></span><span class="line"><span class="cl"> r  b   swpd   free   buff  cache
</span></span><span class="line"><span class="cl"> <span class="m">2</span>  <span class="m">0</span> <span class="m">7102404</span> <span class="m">1392528</span>     <span class="m">36</span> <span class="m">12335148</span>
</span></span><span class="line"><span class="cl"> <span class="m">0</span>  <span class="m">0</span> <span class="m">7102404</span> <span class="m">1392560</span>     <span class="m">36</span> <span class="m">12335188</span>
</span></span><span class="line"><span class="cl"> <span class="m">0</span>  <span class="m">0</span> <span class="m">7102404</span> <span class="m">1373640</span>     <span class="m">36</span> <span class="m">12349928</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> ---swap-- -----io----
</span></span><span class="line"><span class="cl">  si   so    bi    bo
</span></span><span class="line"><span class="cl">   <span class="m">8</span>   <span class="m">21</span>   <span class="m">130</span>   <span class="m">724</span>
</span></span><span class="line"><span class="cl">   <span class="m">0</span>    <span class="m">0</span>     <span class="m">0</span>     <span class="m">0</span>
</span></span><span class="line"><span class="cl">   <span class="m">0</span>    <span class="m">0</span>     <span class="m">8</span>    <span class="m">48</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> -system-- -------cpu-------
</span></span><span class="line"><span class="cl"> in     cs us sy id wa st gu
</span></span><span class="line"><span class="cl"> <span class="m">2851</span>   <span class="m">19</span> <span class="m">15</span>  <span class="m">7</span> <span class="m">77</span>  <span class="m">0</span>  <span class="m">0</span>  <span class="m">0</span>
</span></span><span class="line"><span class="cl"> <span class="m">5779</span> <span class="m">7246</span> <span class="m">14</span> <span class="m">10</span> <span class="m">77</span>  <span class="m">0</span>  <span class="m">0</span>  <span class="m">0</span>
</span></span><span class="line"><span class="cl"> <span class="m">5141</span> <span class="m">6525</span> <span class="m">12</span>  <span class="m">9</span> <span class="m">79</span>  <span class="m">0</span>  <span class="m">0</span>  <span class="m">0</span>
</span></span></code></pre></div><h3 id="anatomy-of-the-output" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#anatomy-of-the-output" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="anatomy-of-the-output">Anatomy of the output</a></h3><p>From the <code>vmstat(8)</code> manpage:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">Procs
</span></span><span class="line"><span class="cl">    r: The number of runnable processes (running or waiting
</span></span><span class="line"><span class="cl">       for run time).
</span></span><span class="line"><span class="cl">    b: The number of processes blocked waiting for I/O to
</span></span><span class="line"><span class="cl">       complete.
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">Memory
</span></span><span class="line"><span class="cl">    These are affected by the --unit option.
</span></span><span class="line"><span class="cl">    swpd: the amount of swap memory used.
</span></span><span class="line"><span class="cl">    free: the amount of idle memory.
</span></span><span class="line"><span class="cl">    buff: the amount of memory used as buffers.
</span></span><span class="line"><span class="cl">    cache: the amount of memory used as cache.
</span></span><span class="line"><span class="cl">    inact: the amount of inactive memory.  (-a option)
</span></span><span class="line"><span class="cl">    active: the amount of active memory.  (-a option)
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">Swap
</span></span><span class="line"><span class="cl">    These are affected by the --unit option.
</span></span><span class="line"><span class="cl">    si: Amount of memory swapped in from disk (/s).
</span></span><span class="line"><span class="cl">    so: Amount of memory swapped to disk (/s).
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">IO
</span></span><span class="line"><span class="cl">    bi: Kibibyte received from a block device (KiB/s).
</span></span><span class="line"><span class="cl">    bo: Kibibyte sent to a block device (KiB/s).
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">System
</span></span><span class="line"><span class="cl">    in: The number of interrupts per second, including
</span></span><span class="line"><span class="cl">        the clock.
</span></span><span class="line"><span class="cl">    cs: The number of context switches per second.
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">CPU
</span></span><span class="line"><span class="cl">    These are percentages of total CPU time.
</span></span><span class="line"><span class="cl">    us: Time spent running non-kernel code.  (user time,
</span></span><span class="line"><span class="cl">        including nice time)
</span></span><span class="line"><span class="cl">    sy: Time spent running kernel code.  (system time)
</span></span><span class="line"><span class="cl">    id: Time spent idle.  Prior to Linux 2.5.41, this
</span></span><span class="line"><span class="cl">        includes IO-wait time.
</span></span><span class="line"><span class="cl">    wa: Time spent waiting for IO.  Prior to Linux 2.5.41,
</span></span><span class="line"><span class="cl">        included in idle.
</span></span><span class="line"><span class="cl">    st: Time stolen from a virtual machine.  Prior to
</span></span><span class="line"><span class="cl">        Linux 2.6.11, unknown.
</span></span><span class="line"><span class="cl">    gu: Time spent running KVM guest code (guest time,
</span></span><span class="line"><span class="cl">        including guest nice).
</span></span></code></pre></div><h3 id="practical-diagnostics" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#practical-diagnostics" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="practical-diagnostics">Practical diagnostics</a></h3><table>
  <thead>
      <tr>
          <th>Section</th>
          <th>Key Fields</th>
          <th>What to watch</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Procs</td>
          <td><code>r</code> (run-queue),<br><code>b</code> (blocked)</td>
          <td><code>r</code> &gt; CPU cores = contention</td>
      </tr>
      <tr>
          <td>Memory</td>
          <td><code>swpd</code>, <code>free</code>, <code>buff</code>, <code>cache</code></td>
          <td>Rising <code>swpd</code> with falling <code>free</code> = pressure</td>
      </tr>
      <tr>
          <td>Swap</td>
          <td><code>si</code>, <code>so</code></td>
          <td>Non-zero so means the kernel is swapping out</td>
      </tr>
      <tr>
          <td>IO</td>
          <td><code>bi</code>, <code>bo</code></td>
          <td>High bo + high wa hints at write-heavy workloads</td>
      </tr>
      <tr>
          <td>System</td>
          <td><code>in</code>, <code>cs</code></td>
          <td>Sudden spikes may indicate interrupt storms</td>
      </tr>
      <tr>
          <td>CPU</td>
          <td><code>us</code>, <code>sy</code>, <code>id</code>, <code>wa</code>, <code>st</code></td>
          <td>High wa (I/O wait) = storage bottleneck</td>
      </tr>
  </tbody>
</table>
<h4 id="catching-a-memory-leak" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#catching-a-memory-leak" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="catching-a-memory-leak">Catching a memory leak</a></h4><p>Run <code>vmstat 500</code> in one terminal while your suspect application runs in another. If <code>free</code> keeps falling and <code>si</code>/<code>so</code> climb over successive samples, physical RAM is being exhausted and the kernel starts swapping, which is classic leak behavior.</p>
<h4 id="finding-io-saturation" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#finding-io-saturation" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="finding-io-saturation">Finding I/O saturation</a></h4><p>When <code>wa</code> (CPU wait) and <code>bo</code> (blocks out) soar while <code>r</code> remains modest, the CPU is idle but stuck waiting for the disk. Consider adding faster storage or tuning I/O scheduler parameters.</p>
<h4 id="detecting-cpu-over-commit" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#detecting-cpu-over-commit" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="detecting-cpu-over-commit">Detecting CPU over-commit</a></h4><p>A sustained <code>r</code> that is double the number of logical cores with low <code>wa</code> and plenty of <code>free</code> means CPU is the bottleneck, not memory or I/O. Use <code>top</code> or <code>htop</code> to locate the busiest processes to scale out workloads accordingly.</p>
<h2 id="conclusion" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#conclusion" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="conclusion">Conclusion</a></h2><p>Mastering <code>free</code> and <code>vmstat</code> gives you a lens into memory usage, swap activity, I/O latency, and CPU load. For everyday debugging: start with <code>free</code> to check if your system is truly out of memory, then use <code>vmstat</code> to reveal the reason, whether it&rsquo;s memory leaks, disk bottlenecks, or CPU saturation.</p>
<p>Stay tuned for the next piece in our &ldquo;System insights with command-line tools&rdquo; series and happy Linux troubleshooting!</p>
]]></content><category scheme="taxonomy:tags" term="toolbox" label="toolbox"/><category scheme="taxonomy:tags" term="free" label="free"/><category scheme="taxonomy:tags" term="vmstat" label="vmstat"/></entry><entry><title type="html">Making sense of software licensing with FSFE REUSE: A guide for open source developers, tips and tricks.</title><id>tag:foundata.com,2025-06-18:/en/blog/2025/fsfe-reuse-open-source-licensing-tips-tricks-spdx-sbom/</id><published>2025-06-18T10:10:00Z</published><updated>2025-06-18T10:10:00Z</updated><link href="https://foundata.com/en/blog/2025/fsfe-reuse-open-source-licensing-tips-tricks-spdx-sbom/?utm_source=feed-atom" rel="alternate" type="text/html"/><link href="https://foundata.com/de/blog/2025/fsfe-reuse-lizenzverwaltung-open-source-tipps-spdx-sbom/?utm_source=feed-atom" rel="alternate" type="text/html" hreflang="de"/><link href="https://foundata.com/en/blog/2024/use-gpl-or-later/?utm_source=feed-atom" rel="related" type="text/html" title='Please use GPLv3 "or-later" instead of "only"'/><link href="https://foundata.com/en/blog/2024/copyleft-open-source-licenses/?utm_source=feed-atom" rel="related" type="text/html" title="Use copyleft licenses for open source or life with the consequences"/><link href="https://foundata.com/en/blog/2024/system-insights-command-line-lslogins-lsmod/?utm_source=feed-atom" rel="related" type="text/html" title="System insights with command-line tools: lslogins and lsmod"/><link href="https://foundata.com/en/blog/2024/system-insights-command-line-lsof-lsblk/?utm_source=feed-atom" rel="related" type="text/html" title="System insights with command-line tools: lsof and lsblk"/><link href="https://foundata.com/en/blog/2024/system-insights-command-line-lscpu-lsusb/?utm_source=feed-atom" rel="related" type="text/html" title="System insights with command-line tools: lscpu and lsusb"/><author><name>Andreas Haerter</name><uri>https://andreashaerter.com/</uri></author><summary type="html">Learn how the FSFE REUSE specification can help you manage licenses with clarity and precision.</summary><content type="html" xml:base="https://foundata.com/"><![CDATA[<p><em>Note: This article was originally released <a href="https://fedoramagazine.org/beginners-guide-for-open-source-developers-for-software-licensing-with-fsfe-reuse/" target="_blank" rel="noreferrer noopener">in the Fedora Magazine</a>.</em></p>
<p>Among the many details developers juggle, software licensing is often treated as an afterthought. We know we need it. However, faced with choosing the right license, tracking inherited code, and keeping things consistent, license management can feel like a bureaucratic burden.</p>
<p>Licensing is what makes the <a href="https://reuse.software/" target="_blank" rel="noreferrer noopener">REUSE project</a>, maintained by the <a href="https://fsfe.org/" target="_blank" rel="noreferrer noopener">Free Software Foundation Europe (FSFE)</a>, such an interesting and important effort. It does not try to replace the legal work involved in choosing a license or deciphering obligations. Instead, <strong>REUSE focuses on the mechanics of software licensing</strong>. It addresses <strong>how we communicate licensing clearly, unambiguously, and reliably in the code itself</strong>. REUSE has been adopted by a <a href="https://api.reuse.software/projects" target="_blank" rel="noreferrer noopener">lot of projects already</a>. These include <a href="https://github.com/SAP/openui5/blob/master/REUSE.toml" target="_blank" rel="noreferrer noopener">SAP</a>, <a href="https://github.com/nextcloud/server/blob/cf1eed2769d928f4a7fe4543d51994331701f2d9/.reuse/dep5" target="_blank" rel="noreferrer noopener">Nextcloud</a> and numerous Ansible community roles and collections.</p>
<p>I recently went down the licensing and supply chain rabbit hole myself. I had to figure out how to apply it to <a href="https://github.com/foundata/" target="_blank" rel="noreferrer noopener">open source projects we work on</a> and explain it to others. Thus, I had the unique experience of learning it from scratch while also teaching it. That process gave me insight into what makes REUSE helpful. I learned where the roadblocks are, and how you can start using it in your own open source work. So this article aims to give additional reasoning and insights for every day usage beyond the scope of a quick start tutorial.</p>
<p>For those who prefer video, I also gave a <a href="https://media.ccc.de/v/gpn23-268-fsfe-reuse-einfache-lizenz-und-quellenverwaltung-fr-software-projekte" target="_blank" rel="noreferrer noopener">REUSE presentation on this topic at GPN23 in German</a> (it contains essentially the same content as the text):</p>
<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;">
<iframe src="https://media.ccc.de/v/gpn23-268-fsfe-reuse-einfache-lizenz-und-quellenverwaltung-fr-software-projekte/oembed" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="Media CCC Video"></iframe>
</div>
<h2 id="why-licensing-still-feels-broken" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#why-licensing-still-feels-broken" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="why-licensing-still-feels-broken">Why licensing still feels broken</a></h2><p>If you&rsquo;ve ever tried to make sense of licensing in a codebase with contributions from half a dozen sources, or tried to package software only to find ambiguous or conflicting license declarations, you&rsquo;ve seen the brokenness first hand. It&rsquo;s a common pain point.</p>
<p>You start coding. A <code>LICENSE</code> file goes in the root. Maybe it&rsquo;s <a href="https://choosealicense.com/licenses/mit/" target="_blank" rel="noreferrer noopener">MIT</a>, maybe <a href="https://choosealicense.com/licenses/apache-2.0/" target="_blank" rel="noreferrer noopener">Apache 2.0</a>, maybe <a href="https://foundata.com/en/blog/2024/use-gpl-or-later/">GPLv3-or-later</a>. We figure that&rsquo;s enough. For the most part, tools like <a href="https://github.com/licensee/licensee" target="_blank" rel="noreferrer noopener">Licensee</a> (which Github uses) will scan that file and report the project as single-licensed under whatever it finds.</p>
<p>But that is only part of the picture.</p>
<p>Real-world projects grow messy over time. Files come in from various places. Pull requests, upstream forks, old backups. Someone pastes in a script from Stack Overflow. Someone else uploads a code generator output. Over time, the repository becomes a tangle of files with unclear origins. The top-level <code>LICENSE</code> file can&rsquo;t speak for all of it any more. But the tools like licensee don&rsquo;t know that, and often neither do the maintainers.</p>
<p><strong>If you provide code without clear licensing information, you make it hard for the open source ecosystem to collaborate with or consume your work</strong>. Unfortunately, approaches to <strong>automatic license detection can&rsquo;t deliver the needed certainty</strong>. They rely on fuzzy matching, heuristics, and assumptions (like there is &ldquo;one license for the project&rdquo;). This just does not cut it when legal clarity is required. Automatic license heuristics are complicated and will never deliver reliable results for all the possible use cases.</p>
<h2 id="fsfe-reuse-to-the-rescue" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#fsfe-reuse-to-the-rescue" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="fsfe-reuse-to-the-rescue">FSFE REUSE to the rescue</a></h2><p>Rather than trying to detect or infer licensing, REUSE asks developers to be explicit in a machine-readable, auditable way:</p>
<ol>
<li><strong><a href="https://reuse.software/spec-3.3/#license-files" target="_blank" rel="noreferrer noopener">There has to be a text copy of every used license</a> below a <code>LICENSES/</code> directory</strong><sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup> in the root of the project.</li>
<li><strong>Each file in your project must have <a href="https://reuse.software/spec-3.3/#licensing-information" target="_blank" rel="noreferrer noopener">machine-readable copyright and licensing information associated</a> with it</strong>.</li>
</ol>
<p>Again: This matters. It means anyone—an auditor, a packager, a contributor, or a compliance team—can look at any file in your repository and immediately understand its legal status. There is no guessing, no cross-referencing, no &ldquo;well maybe this falls under the MIT license because the rest of the project does.&rdquo; It&rsquo;s explicit. It&rsquo;s standardized. And it is quickly <a href="https://reuse.readthedocs.io/en/stable/man/reuse-lint.html" target="_blank" rel="noreferrer noopener">lintable</a> which is great for teams with <a href="https://en.wikipedia.org/wiki/Continuous_integration" target="_blank" rel="noreferrer noopener">Continuous Integration</a>.</p>
<p>Following REUSE, adding machine-readable copyright and licensing information can be done in the following ways:</p>
<ul>
<li><strong><a href="https://reuse.software/spec-3.3/#comment-headers" target="_blank" rel="noreferrer noopener">Comment headers</a> or <code>&lt;filename&gt;.license</code></strong> for uncommentable files.</li>
<li><strong><a href="https://reuse.software/spec-3.3/#reusetoml" target="_blank" rel="noreferrer noopener"><code>REUSE.toml</code></a>, a machine-readable copyright file</strong> to address file and directory names. This is especially handy to define:
<ul>
<li>a default license for your project.</li>
<li>deviant licenses for third party artefacts residing in a sub-directory.</li>
</ul>
</li>
</ul>
<p>REUSE backs up its <a href="https://reuse.software/spec/" target="_blank" rel="noreferrer noopener">specification</a> with a simple, focused, <a href="https://github.com/fsfe/reuse-tool" target="_blank" rel="noreferrer noopener"><code>reuse</code> command-line tool</a>. This makes adoption relatively painless (even though all can also be done manually). <a href="https://reuse.software/comparison/" target="_blank" rel="noreferrer noopener">REUSE fits nicely into the ecosystem</a>, especially by relying on <a href="https://spdx.dev/" target="_blank" rel="noreferrer noopener">Software Package Data Exchange (SPDX)</a> and <a href="https://github.com/david-a-wheeler/spdx-tutorial/blob/master/README.md#spdx-license-identifiers" target="_blank" rel="noreferrer noopener">SPDX license identifiers</a>.</p>
<h2 id="usage" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#usage" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="usage">Usage</a></h2><p>The <a href="https://reuse.software/tutorial/" target="_blank" rel="noreferrer noopener">official REUSE tutorial</a> and the <a href="https://github.com/fsfe/reuse-tool#usage" target="_blank" rel="noreferrer noopener">tool usage section</a> is really good so I will just reproduce a quick start here:</p>
<ol>
<li>Put your licenses in the <code>LICENSES/</code> directory.</li>
<li>Add a comment header to each file that says something like
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">SPDX-License-Identifier: GPL-3.0-or-later
</span></span><span class="line"><span class="cl">SPDX-FileCopyrightText: $YEAR $NAME
</span></span></code></pre></div>You can be flexible with the format, just make sure that the line starts with <code>SPDX-License-Identifier:</code> and/or <code>SPDX-FileCopyrightText:</code></li>
</ol>
<h3 id="comment-headers" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#comment-headers" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="comment-headers">Comment headers</a></h3><p><a href="https://github.com/fsfe/reuse-docs/issues/117#issuecomment-1306963966" target="_blank" rel="noreferrer noopener">REUSE</a>, and many organizations like <a href="https://www.gnu.org/licenses/gpl-howto.html.en#why-license-notices" target="_blank" rel="noreferrer noopener">GNU</a>, recommend including license header comments in source files as it helps to prevent confusion or errors. So even if the <code>REUSE.toml</code> copyright file exists as the central place for licensing information, sometimes files get copied or forked into new projects and third parties might not have a well organized repository bureaucracy. Without a statement about what their license is, moving single files into another context might eliminate all trace of that information.</p>
<p>Example of a header comment:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl"># SPDX-FileCopyrightText: Andreas Haerter, ACME Corp (https://example.com)
</span></span><span class="line"><span class="cl"># SPDX-License-Identifier: CC-BY-SA-4.0
</span></span></code></pre></div><p>One with <a href="https://reuse.software/faq/#multi-licensing" target="_blank" rel="noreferrer noopener">dual-licensing</a>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">/*
</span></span><span class="line"><span class="cl">  SPDX-FileCopyrightText: Jane Doe &lt;j.doe@example.com&gt;
</span></span><span class="line"><span class="cl">  SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
</span></span><span class="line"><span class="cl">*/
</span></span></code></pre></div><h3 id="reusetoml" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#reusetoml" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="reusetoml"><code>REUSE.toml</code></a></h3><p>You might come to the conclusion that to skip adding headers to every file and only using a <code>REUSE.toml</code> is better for your project … fair enough and that will still be compliant. It is also possible to <a href="https://reuse.software/faq/#bulk-license" target="_blank" rel="noreferrer noopener">bulk-license whole directories</a> using this technique. The file format is <a href="https://reuse.software/spec-3.3/#reusetoml" target="_blank" rel="noreferrer noopener">specified</a>, but a simple example helps to get started:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="nx">version</span> <span class="p">=</span> <span class="mi">1</span>
</span></span><span class="line"><span class="cl"><span class="nx">SPDX-PackageName</span> <span class="p">=</span> <span class="s2">&#34;Foo bar project&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nx">SPDX-PackageDownloadLocation</span> <span class="p">=</span> <span class="s2">&#34;https://git.example.com/foobar&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nx">SPDX-PackageSupplier</span> <span class="p">=</span> <span class="s2">&#34;ACME Inc. (https://example.com)&#34;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="p">[[</span><span class="nx">annotations</span><span class="p">]]</span>
</span></span><span class="line"><span class="cl"><span class="nx">path</span> <span class="p">=</span> <span class="s2">&#34;**&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nx">precedence</span> <span class="p">=</span> <span class="s2">&#34;closest&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nx">SPDX-FileCopyrightText</span> <span class="p">=</span> <span class="s2">&#34;ACME Inc.&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nx">SPDX-License-Identifier</span> <span class="p">=</span> <span class="s2">&#34;LGPL-2.1-or-later&#34;</span>
</span></span></code></pre></div><h3 id="verification" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#verification" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="verification">Verification</a></h3><p>Now verify your work using <a href="https://reuse.readthedocs.io/en/stable/man/reuse-lint.html" target="_blank" rel="noreferrer noopener"><code>reuse lint</code></a>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ reuse lint
</span></span><span class="line"><span class="cl"><span class="o">[</span>...<span class="o">]</span>
</span></span><span class="line"><span class="cl">Congratulations! Your project is compliant with version 3.4 of the REUSE Specification :-<span class="o">)</span>
</span></span></code></pre></div><h2 id="demo" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#demo" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="demo">Demo</a></h2><p>The FSFE created a small screencast<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup>, which follows the <a href="https://reuse.software/tutorial" target="_blank" rel="noreferrer noopener">tutorial</a>, making the <a href="https://github.com/fsfe/reuse-example/" target="_blank" rel="noreferrer noopener">REUSE example repository</a> compliant:</p>
<figure><img class="mx-auto my-0 rounded-xs" alt="REUSE tutorial: Screencast" src="./reuse-tool.gif" loading="lazy"></figure><h2 id="tips-and-tricks" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#tips-and-tricks" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="tips-and-tricks">Tips and tricks</a></h2><h3 id="needed-vocabulary-when-you-start-learning-or-teaching" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#needed-vocabulary-when-you-start-learning-or-teaching" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="needed-vocabulary-when-you-start-learning-or-teaching">Needed vocabulary when you start learning or teaching</a></h3><p>To follow documentation and communication in the licensing space, it is important to know about the meaning of:</p>
<ul>
<li><strong><a href="https://spdx.dev/" target="_blank" rel="noreferrer noopener">Software Package Data Exchange (SPDX)</a> and <a href="https://github.com/david-a-wheeler/spdx-tutorial/blob/master/README.md#spdx-license-identifiers" target="_blank" rel="noreferrer noopener">SPDX license identifiers</a>:</strong> A standard for identifying licenses using short, consistent identifiers (like MIT or GPL-3.0-only). It simplifies license tracking and automation.</li>
<li><strong><a href="https://about.gitlab.com/blog/2022/10/25/the-ultimate-guide-to-sboms/#what-is-an-sbom%3F" target="_blank" rel="noreferrer noopener">Software Bill of Materials (SBOM)</a></strong>: A structured list of all software components and their licenses in a project. It helps with transparency, security audits, and legal compliance.</li>
<li><strong><a href="https://en.wikipedia.org/wiki/Copyleft" target="_blank" rel="noreferrer noopener">Copyleft</a> (license)</strong>: A type of open source license that ensures derivative works remain under the same license. It protects user freedoms by requiring shared modifications. The GPL is a well-known example.</li>
<li><strong>Permissive (license)</strong>: A license that allows code to be reused with minimal conditions, including in proprietary software, without giving back modifications. Common examples include MIT, BSD, and Apache 2.0.</li>
<li><strong>TOML</strong>: A configuration <a href="https://toml.io/en/v1.0.0" target="_blank" rel="noreferrer noopener">file format</a>. <code>REUSE.toml</code> (a machine-readable file in your project&rsquo;s root directory) uses it to declare licensing information based on filename patterns.</li>
<li><strong>DEP5:</strong> A machine-readable <a href="https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/" target="_blank" rel="noreferrer noopener">debian/copyright file</a> which was <a href="https://reuse.software/faq/#dep5-history" target="_blank" rel="noreferrer noopener">used before <code>REUSE.toml</code></a>. DEP5, while still supported, has been deprecated since the introduction of <code>REUSE.toml</code>. This is important to know when hitting older documentation or tutorials.</li>
</ul>
<h3 id="my-personal-killer-feature-additional-comments-in-reusetoml" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#my-personal-killer-feature-additional-comments-in-reusetoml" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="my-personal-killer-feature-additional-comments-in-reusetoml">My personal killer feature: Additional comments in <code>REUSE.toml</code></a></h3><p>It might sound trivial, but it was always cumbersome for me to keep track of the originally used download URLs and other common data around simple third-party files, like &ldquo;this small icon there&rdquo;. From my point of view, the <code>RESUE.toml</code> file is the ideal place to keep additional data on third party files by using SPDX-FileComment without cluttering the repository or the end-user documentation. If there is at least one example, in my experience, maintaining source information and reasoning for third-party files is quickly adopted even in teams without many regulations:</p>
<p><strong>Example 1: <a href="https://github.com/foundata/chocolatey-usewindow.extension/blob/78f22260526a319e83e62456922bb482564f1e41/REUSE.toml#L22-L34" target="_blank" rel="noreferrer noopener"><code>REUSE.toml</code> with sections tracking the original download URLs or notes</a></strong></p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[...]</span>
</span></span><span class="line"><span class="cl"><span class="p">[[</span><span class="nx">annotations</span><span class="p">]]</span>
</span></span><span class="line"><span class="cl"><span class="nx">path</span> <span class="p">=</span> <span class="s2">&#34;assets/images/window.svg&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nx">precedence</span> <span class="p">=</span> <span class="s2">&#34;closest&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nx">SPDX-FileCopyrightText</span> <span class="p">=</span> <span class="s2">&#34;2022 Refactoring UI Inc.&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nx">SPDX-License-Identifier</span> <span class="p">=</span> <span class="s2">&#34;MIT&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nx">SPDX-FileComment</span> <span class="p">=</span> <span class="s2">&#34;https://github.com/tailwindlabs/heroicons/blob/master/optimized/24/outline/window.svg&#34;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="p">[[</span><span class="nx">annotations</span><span class="p">]]</span>
</span></span><span class="line"><span class="cl"><span class="nx">path</span> <span class="p">=</span> <span class="p">[</span><span class="s2">&#34;extensions/Find-WindowHandle.ps1&#34;</span><span class="p">,</span> <span class="s2">&#34;extensions/Helper.ps1&#34;</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"><span class="nx">precedence</span> <span class="p">=</span> <span class="s2">&#34;closest&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nx">SPDX-FileCopyrightText</span> <span class="p">=</span> <span class="s2">&#34;2018 Grégoire Geis (https://github.com/71/Focus-Window/)&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nx">SPDX-License-Identifier</span> <span class="p">=</span> <span class="s2">&#34;MIT&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nx">SPDX-FileComment</span> <span class="p">=</span> <span class="s2">&#34;Slightly adapted for this project by foundata GmbH (https://foundata.com)&#34;</span>
</span></span><span class="line"><span class="cl"><span class="p">[...]</span>
</span></span></code></pre></div><p><strong>Example 2:</strong> The <a href="https://github.com/SAP/openui5/blob/7ff18ab1ded47570228b5fc6c3da1ad135d6bc3e/REUSE.toml#L539-L561" target="_blank" rel="noreferrer noopener">REUSE.toml from SAP/openui5</a> which uses the file patterns and comments to keep track of single files copied from other projects:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[...]</span>
</span></span><span class="line"><span class="cl"><span class="p">[[</span><span class="nx">annotations</span><span class="p">]]</span>
</span></span><span class="line"><span class="cl"><span class="nx">path</span> <span class="p">=</span> <span class="s2">&#34;src/sap.ui.integration/test/sap/ui/integration/demokit/cardExplorer/webapp/thirdparty/CfWorkerJsonSchemaValidator.js&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nx">precedence</span> <span class="p">=</span> <span class="s2">&#34;aggregate&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nx">SPDX-FileCopyrightText</span> <span class="p">=</span> <span class="s2">&#34;2020 Jeremy Danyow&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nx">SPDX-License-Identifier</span> <span class="p">=</span> <span class="s2">&#34;MIT&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nx">SPDX-FileComment</span> <span class="p">=</span> <span class="s2">&#34;these files belong to: @cfworker/json-schema&#34;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c"># Library: sap.ui.webc.common:</span>
</span></span><span class="line"><span class="cl"><span class="p">[[</span><span class="nx">annotations</span><span class="p">]]</span>
</span></span><span class="line"><span class="cl"><span class="nx">path</span> <span class="p">=</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/base/**&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/theming/**&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/localization/**&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/icons/**&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/icons-tnt/**&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;src/sap.ui.webc.common/src/sap/ui/webc/common/thirdparty/icons-business-suite/**&#34;</span>
</span></span><span class="line"><span class="cl"><span class="p">]</span>
</span></span><span class="line"><span class="cl"><span class="nx">precedence</span> <span class="p">=</span> <span class="s2">&#34;aggregate&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nx">SPDX-FileCopyrightText</span> <span class="p">=</span> <span class="s2">&#34;SAP&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nx">SPDX-License-Identifier</span> <span class="p">=</span> <span class="s2">&#34;Apache-2.0&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nx">SPDX-FileComment</span> <span class="p">=</span> <span class="s2">&#34;these files belong to: UI5 Web Components&#34;</span>
</span></span><span class="line"><span class="cl"><span class="p">[...]</span>
</span></span></code></pre></div><h3 id="readme-section-template-about-licensing-and-copyright-for-humans" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#readme-section-template-about-licensing-and-copyright-for-humans" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="readme-section-template-about-licensing-and-copyright-for-humans"><code>README</code> section template about licensing and copyright for humans</a></h3><p>I find it useful to have a generic, easy to adapt text snippet for the README.md or a comparable central place which is easy for humans to notice and read. I created and use the following template, taking advantage of the existing REUSE information to make the section basically maintenance free without being useless:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">## Licensing, copyright
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">&lt;!--REUSE-IgnoreStart--&gt;
</span></span><span class="line"><span class="cl">Copyright (c) YYYY, ACME Inc.
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">This project is licensed under the GNU General Public License v3.0 or later (SPDX-License-Identifier: `GPL-3.0-or-later`), see [`LICENSES/GPL-3.0-or-later.txt`](LICENSES/GPL-3.0-or-later.txt) for the full text.
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">The [`REUSE.toml`](REUSE.toml) file provides detailed licensing and copyright information in a human- and machine-readable format. This includes parts that may be subject to different licensing or usage terms, such as third-party components. The repository conforms to the [REUSE specification](https://reuse.software/spec/). You can use [`reuse spdx`](https://reuse.readthedocs.io/en/latest/readme.html#cli) to create a [SPDX software bill of materials (SBOM)](https://en.wikipedia.org/wiki/Software_Package_Data_Exchange).
</span></span><span class="line"><span class="cl">&lt;!--REUSE-IgnoreEnd--&gt;
</span></span></code></pre></div><p>Replace <code>YYYY</code> with the year of the first release or <a href="https://reuse.readthedocs.io/en/latest/scripts.html#starting-point-of-the-codebase" target="_blank" rel="noreferrer noopener">code contribution</a> and adapt the mentioned license, filenames and links as needed. The HTML comments prevent REUSE linting errors when e.g. listing multiple licenses.</p>
<p>The wording is already pointing to the copyright file (<code>REUSE.toml</code>) and mentions that parts of the project might be subject to different licensing than the main one. If this is not good enough, feel free to adapt the wording of the main &ldquo;licensed under&rdquo; sentence to highlight the main licensing rules without the need to maintain every single bit outside of the copyright file. Examples (adapt as needed):</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">The project is dual-licensed under the
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">* GNU General Public License v3.0 or later (SPDX-License-Identifier: `GPL-3.0-or-later`), see [`LICENSES/GPL-3.0-or-later.txt`](./LICENSES/GPL-3.0-or-later.txt) for the full text.
</span></span><span class="line"><span class="cl">* Apache License 2.0 (SPDX-License-Identifier: `Apache-2.0`), see [`LICENSES/Apache-2.0.txt`](./LICENSES/Apache-2.0.txt) for the full text.
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">[... usual template follows ...]
</span></span></code></pre></div><h3 id="license-detection-on-github-or-gitlab" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#license-detection-on-github-or-gitlab" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="license-detection-on-github-or-gitlab">License detection on Github or Gitlab</a></h3><p>If you follow REUSE, you will notice that Github and Gitlab are no longer able to detect licensing information for your repository.</p>
<p>Even if automatic licensing is broken by design for the reasons outlined above, it is understood that it would be nice if all the broken license detection tools spit out something, even unreliable but working, for indexes and searches (for the sole reason of not having a disadvantage if inexperienced users are searching for projects and filter by often broken meta data).</p>
<p>If you need this, put the stated &ldquo;license with the highest freedom protections&rdquo; just for search-indexes and GitHub in a <code>LICENSE</code> or <code>COPYING</code> file in the root directory of your project:</p>
<ol>
<li><a href="https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository#detecting-a-license" target="_blank" rel="noreferrer noopener">GitHub uses Licensee</a> to attempt to identify the license of a project and <a href="https://github.com/licensee/licensee/issues/490" target="_blank" rel="noreferrer noopener">Licensee does not support the REUSE specification</a>.</li>
<li>A workaround to fix the automatic license detection of GitHub and <a href="https://forum.openmod.org/t/reuse-incompatible-to-auto-detection-of-license-s/3590" target="_blank" rel="noreferrer noopener">others</a> is to place an additional <code>LICENSE</code> or <code>COPYING</code> file in the root directory of your project. This is <a href="https://reuse.software/faq/#tradition" target="_blank" rel="noreferrer noopener">allowable by REUSE</a>. These files are explicitly <a href="https://github.com/fsfe/reuse-tool/blob/0e111c423ccf927f73a9ae7b39d3f88268b015b9/src/reuse/__init__.py#L66-L77" target="_blank" rel="noreferrer noopener">ignored by the toolset</a> and do not need an additional <code>.license</code> file or header.</li>
<li>If you want to prevent a duplication of License texts, beware of another issue with Licensee: You can place a symlink at <code>LICENSES/&lt;your license&gt;.txt</code> pointing to the <code>LICENSE</code> or <code>COPYING</code> file in the project&rsquo;s root directory. reuse lint will follow that link. <a href="https://github.com/licensee/licensee/pull/42" target="_blank" rel="noreferrer noopener">Licensee sadly does not even support symlinks</a>, so a more logical symlink from <code>LICENSE</code> or <code>COPYING</code> pointing to <code>LICENSES/&lt;your license&gt;.txt</code> is not solving the issue. I therefore recommend a real <em>copy</em> instead of a symlink to keep things accessible when using the workaround.</li>
</ol>
<p>I, for myself, would use this workaround <em>only</em> if a single license is used for all of the project&rsquo;s files. This would prevent misunderstandings or conflicts and simply ignore GitHub&rsquo;s limited behavior in all other cases.</p>
<h3 id="years-in-copyright-texts" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#years-in-copyright-texts" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="years-in-copyright-texts">Years in copyright texts</a></h3><p>This is not exactly a REUSE topic but I noticed it is discussed quite a lot when a project starts adopting REUSE. <a href="https://en.wikipedia.org/wiki/IANAL" target="_blank" rel="noreferrer noopener">IANAL</a>, but it is not necessary to update the copyright year since the main legal intention is to state the year of the first public release or code contribution. But it is common to do so anyway, especially since it shows third parties that a project is still alive.</p>
<p>I usually propose the following which might also be a useful technique for your project:</p>
<ul>
<li>Update the copyright data but maintain the copyright year only at central places like a project&rsquo;s <code>README.md</code> reduce the maintenance effort.</li>
<li>Simply add each year with a release or updates separated by commas. You can use a timespan (<code>yearX-yearY</code>) for multiple subsequent years.</li>
<li>Example:
<ul>
<li>The first release and copyright statement was <code>Copyright (c) 2013</code>.</li>
<li>There were releases or updates in several but not all years afterwards:
<ul>
<li>2023 → <code>Copyright (c) 2013, 2015, 2018-2021, 2023</code>.</li>
<li>2015 → <code>Copyright (c) 2013, 2015</code>.</li>
<li>2018 → <code>Copyright (c) 2013, 2015, 2018</code>.</li>
<li>2019 → <code>Copyright (c) 2013, 2015, 2018, 201</code>9.</li>
<li>2020 → <code>Copyright (c) 2013, 2015, 2018-2020</code>.</li>
<li>2021 → <code>Copyright (c) 2013, 2015, 2018-2021</code>.</li>
</ul>
</li>
</ul>
</li>
</ul>
<h2 id="conclusion" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#conclusion" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="conclusion">Conclusion</a></h2><p>Licensing clarity is needed for sustainable collaboration in open source. The REUSE specification doesn&rsquo;t try to replace legal frameworks or licensing decisions, but it makes the messy practicalities of license management predictable, explicit, and automatable.</p>
<p>Adopting REUSE can feel like extra effort at first, especially for existing codebases. But once in place, it pays off by making your project easier to understand, maintain, package, and … reuse… 🙂 . REUSE helps you express the legal structure of your project in a way that machines and humans can agree on. And that&rsquo;s worth a lot.</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>Using the<code>LICENSES/</code> directory is also recommended by the <a href="https://github.com/coreinfrastructure/best-practices-badge/blob/main/docs/criteria.md#license_location" target="_blank" rel="noreferrer noopener">CII best practices</a>, and implemented by the <a href="https://github.com/torvalds/linux/tree/master/LICENSES" target="_blank" rel="noreferrer noopener">Linux Kernel</a>.&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p>Source: <a href="https://download.fsfe.org/videos/reuse/screencasts/reuse-tool.gif" target="_blank" rel="noreferrer noopener">https://download.fsfe.org/videos/reuse/screencasts/reuse-tool.gif</a>, Copyright © 2001-2025 <a href="https://fsfe.org/" target="_blank" rel="noreferrer noopener">Free Software Foundation Europe</a>, Verbatim copying and distribution is permitted in any medium, provided this notice is preserved.&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content><category scheme="taxonomy:tags" term="open-source" label="open-source"/><category scheme="taxonomy:tags" term="license" label="license"/><category scheme="taxonomy:tags" term="toolbox" label="toolbox"/><category scheme="taxonomy:tags" term="fsfe" label="fsfe"/><category scheme="taxonomy:tags" term="reuse" label="reuse"/><category scheme="taxonomy:tags" term="compliance" label="compliance"/><category scheme="taxonomy:tags" term="spdx" label="spdx"/></entry><entry><title type="html">System insights with command-line tools: lslogins and lsmod</title><id>tag:foundata.com,2024-12-30:/en/blog/2024/system-insights-command-line-lslogins-lsmod/</id><published>2024-12-30T19:57:00Z</published><updated>2024-12-30T19:57:00Z</updated><link href="https://foundata.com/en/blog/2024/system-insights-command-line-lslogins-lsmod/?utm_source=feed-atom" rel="alternate" type="text/html"/><link href="https://foundata.com/de/blog/2024/systemeinblicke-kommandozeile-lslogins-lsmod/?utm_source=feed-atom" rel="alternate" type="text/html" hreflang="de"/><link href="https://foundata.com/en/blog/2024/system-insights-command-line-lsof-lsblk/?utm_source=feed-atom" rel="related" type="text/html" title="System insights with command-line tools: lsof and lsblk"/><link href="https://foundata.com/en/blog/2024/system-insights-command-line-lscpu-lsusb/?utm_source=feed-atom" rel="related" type="text/html" title="System insights with command-line tools: lscpu and lsusb"/><link href="https://foundata.com/en/blog/2024/system-insights-command-line-dmidecode-lspci/?utm_source=feed-atom" rel="related" type="text/html" title="System insights with command-line tools: dmidecode and lspci"/><link href="https://foundata.com/en/blog/2024/cve-2024-6387-regresshion-openssh-rce-vulnerability/?utm_source=feed-atom" rel="related" type="text/html" title="OpenSSH Vulnerability: regreSSHion (CVE-2024-6387), Remote Code Execution (RCE)"/><link href="https://foundata.com/en/blog/2024/quectel-em05-g-thinkpad-t14-gen4-fedora-linux/?utm_source=feed-atom" rel="related" type="text/html" title="Quectel EM05-G (LTE module) with ThinkPad T14 Gen4 on Fedora 39 and 40"/><author><name>Andreas Haerter</name><uri>https://andreashaerter.com/</uri></author><summary type="html">An article introducing the command line tools `lslogins` and `lsmod`.</summary><content type="html" xml:base="https://foundata.com/"><![CDATA[<p><em>Note: This article was originally released <a href="https://fedoramagazine.org/system-insights-command-line-lslogins-lsmod/" target="_blank" rel="noreferrer noopener">in the Fedora Magazine</a>.</em></p>
<p>Continuing our <a href="https://foundata.com/en/blog/2024/system-insights-command-line-lscpu-lsusb/">exploration</a> <a href="https://foundata.com/en/blog/2024/system-insights-command-line-dmidecode-lspci/">of</a> <a href="https://foundata.com/en/blog/2024/system-insights-command-line-lsof-lsblk/">commands</a> that provide insights into the inner workings of your Linux system, we turn our focus to more simple ones like <code>lslogins</code> and <code>lsmod</code>. These tools offer information about user accounts and <a href="https://en.wikipedia.org/wiki/Monolithic_kernel#Loadable_modules" target="_blank" rel="noreferrer noopener">kernel modules</a>, respectively.</p>
<h2 id="lslogins-look-into-user-accounts" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#lslogins-look-into-user-accounts" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="lslogins-look-into-user-accounts"><code>lslogins</code>: Look into User Accounts</a></h2><p><code>lslogins</code> is a command that extracts and displays detailed information about user accounts on your system. It pulls data from <code>/etc/passwd</code> and <code>/etc/shadow</code> files, along with system logs, to give you a comprehensive overview. It is especially useful to look for login failures and to list group memberships.</p>
<h3 id="basic-usage" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#basic-usage" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="basic-usage">Basic Usage</a></h3><p>Run the command without arguments to display a summary of all user accounts:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">lslogins
</span></span></code></pre></div><p>This provides an overview including UID (User ID), GID (Group ID), user name, and last login details.</p>
<h3 id="common-options-and-usage-example" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#common-options-and-usage-example" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="common-options-and-usage-example">Common options and usage example</a></h3><ul>
<li><code>-u</code>: Display only user accounts and <code>root</code> (filtering out system accounts with UIDs below 1000).</li>
<li><code>-G</code>: Display information about exiting groups.</li>
<li><code>-g &lt;group&gt;</code>: Show users of a specific group (e.g. <code>wheel</code> which usually has <code>sudo</code>-permissions on a Red Hat system).</li>
<li><code>-e</code>: Display in an export-able key-value output format, separated by space.</li>
<li><code>-L</code>: List last logins and password information (empty, logged, nologin).</li>
</ul>
<p>Examples, listing the last logins and password information (empty, logged, nologin) of non-system user accounts on my laptop as well as group memberships:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ lslogins -L -p -u
</span></span><span class="line"><span class="cl"> UID USER      LAST-TTY LAST-HOSTNAME LAST-LOGIN PWD-EMPTY PWD-LOCK PWD-DENY NOLOGIN HUSHED PWD-METHOD
</span></span><span class="line"><span class="cl">   <span class="m">0</span> root                                                                          <span class="m">0</span>
</span></span><span class="line"><span class="cl"><span class="m">1000</span> ahaerter  tty2     tty2               01:16                                   <span class="m">0</span>      <span class="m">0</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">$ lslogins -G -u
</span></span><span class="line"><span class="cl"> UID USER       GID GROUP     SUPP-GIDS  SUPP-GROUPS
</span></span><span class="line"><span class="cl">   <span class="m">0</span> root         <span class="m">0</span> root
</span></span><span class="line"><span class="cl"><span class="m">1000</span> ahaerter  <span class="m">1000</span> user      971,10,977 docker,wheel
</span></span></code></pre></div><h2 id="lsmod-listing-kernel-modules-for-further-inspection" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#lsmod-listing-kernel-modules-for-further-inspection" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="lsmod-listing-kernel-modules-for-further-inspection"><code>lsmod</code>: Listing Kernel modules for further inspection</a></h2><p>The Linux kernel is <a href="https://en.wikipedia.org/wiki/Tanenbaum%E2%80%93Torvalds_debate" target="_blank" rel="noreferrer noopener">fundamentally monolithic</a> in design, but it also provides the capability to load and unload modules at runtime. A kernel module is generally understood as a component or an extension of the kernel. For example, hardware drivers (e.g., Wi-Fi cards, sound cards, etc.) are usually implemented as modules. The <code>lsmod</code> command provides a nice overview of all currently loaded kernel modules.</p>
<h3 id="basic-usage-1" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#basic-usage-1" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="basic-usage-1">Basic usage</a></h3><p>Simply type:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">lsmod
</span></span></code></pre></div><p>This displays a table with three columns:</p>
<ol>
<li>Module: The name of the kernel module.</li>
<li>Size: The memory size (in bytes) the module occupies.</li>
<li>Used By: Lists the dependent modules or kernel features.</li>
</ol>
<p>Example output:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ lsmod
</span></span><span class="line"><span class="cl">Module                  Size  Used by
</span></span><span class="line"><span class="cl">overlay               <span class="m">241664</span>  <span class="m">0</span>
</span></span><span class="line"><span class="cl">tun                    <span class="m">73728</span>  <span class="m">2</span>
</span></span><span class="line"><span class="cl">snd_usb_audio         <span class="m">614400</span>  <span class="m">0</span>
</span></span><span class="line"><span class="cl">snd_usbmidi_lib        <span class="m">57344</span>  <span class="m">1</span> snd_usb_audio
</span></span><span class="line"><span class="cl">snd_ump                <span class="m">49152</span>  <span class="m">1</span> snd_usb_audio
</span></span><span class="line"><span class="cl">snd_rawmidi            <span class="m">57344</span>  <span class="m">2</span> snd_usbmidi_lib,snd_ump
</span></span><span class="line"><span class="cl">hid_jabra              <span class="m">16384</span>  <span class="m">0</span>
</span></span><span class="line"><span class="cl">uinput                 <span class="m">20480</span>  <span class="m">0</span>
</span></span><span class="line"><span class="cl">rfcomm                <span class="m">102400</span>  <span class="m">16</span>
</span></span><span class="line"><span class="cl">snd_seq_dummy          <span class="m">12288</span>  <span class="m">0</span>
</span></span><span class="line"><span class="cl">snd_hrtimer            <span class="m">12288</span>  <span class="m">1</span>
</span></span><span class="line"><span class="cl">wireguard             <span class="m">122880</span>  <span class="m">0</span>
</span></span><span class="line"><span class="cl">curve25519_x86_64      <span class="m">36864</span>  <span class="m">1</span> wireguard
</span></span><span class="line"><span class="cl">libcurve25519_generic    <span class="m">45056</span>  <span class="m">2</span> curve25519_x86_64,wireguard
</span></span><span class="line"><span class="cl">ip6_udp_tunnel         <span class="m">16384</span>  <span class="m">1</span> wireguard
</span></span><span class="line"><span class="cl">udp_tunnel             <span class="m">36864</span>  <span class="m">1</span> wireguard
</span></span><span class="line"><span class="cl">nf_conntrack_netbios_ns    <span class="m">12288</span>  <span class="m">1</span>
</span></span><span class="line"><span class="cl">nf_conntrack_broadcast    <span class="m">12288</span>  <span class="m">1</span> nf_conntrack_netbios_ns
</span></span><span class="line"><span class="cl">nft_fib_inet           <span class="m">12288</span>  <span class="m">1</span>
</span></span><span class="line"><span class="cl">nft_fib_ipv4           <span class="m">12288</span>  <span class="m">1</span> nft_fib_inet
</span></span><span class="line"><span class="cl">nft_fib_ipv6           <span class="m">12288</span>  <span class="m">1</span> nft_fib_inet
</span></span><span class="line"><span class="cl">nft_fib                <span class="m">12288</span>  <span class="m">3</span> nft_fib_ipv6,nft_fib_ipv4,nft_fib_inet
</span></span><span class="line"><span class="cl"><span class="o">[</span>...<span class="o">]</span>
</span></span></code></pre></div><h3 id="usage-examples" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#usage-examples" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="usage-examples">Usage examples</a></h3><p>While <code>lsmod</code> doesn’t have options, pairing it with other commands enhances its utility:</p>
<ul>
<li>Combine with <code>modinfo</code>: Get detailed information about a specific module, including its author, license, and description.</li>
<li>Debug with <code>dmesg</code>: Correlate kernel log messages with loaded modules to diagnose boot-time issues.</li>
</ul>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">modinfo &lt;module_name&gt;
</span></span><span class="line"><span class="cl">sudo dmesg <span class="p">|</span> grep &lt;module_name&gt;
</span></span></code></pre></div><h2 id="conclusion" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#conclusion" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="conclusion">Conclusion</a></h2><p>Commands like <code>lslogins</code> and <code>lsmod</code> can give you easy insights into user management and kernel behavior. Try them out today, and think about combining their output with other tools to appreciate their capabilities.</p>
]]></content><category scheme="taxonomy:tags" term="toolbox" label="toolbox"/><category scheme="taxonomy:tags" term="lslogins" label="lslogins"/><category scheme="taxonomy:tags" term="lsmod" label="lsmod"/></entry><entry><title type="html">System insights with command-line tools: lsof and lsblk</title><id>tag:foundata.com,2024-09-11:/en/blog/2024/system-insights-command-line-lsof-lsblk/</id><published>2024-09-11T20:21:00Z</published><updated>2024-09-11T20:21:00Z</updated><link href="https://foundata.com/en/blog/2024/system-insights-command-line-lsof-lsblk/?utm_source=feed-atom" rel="alternate" type="text/html"/><link href="https://foundata.com/de/blog/2024/systemeinblicke-kommandozeile-lsof-lsblk/?utm_source=feed-atom" rel="alternate" type="text/html" hreflang="de"/><link href="https://foundata.com/en/blog/2024/system-insights-command-line-lscpu-lsusb/?utm_source=feed-atom" rel="related" type="text/html" title="System insights with command-line tools: lscpu and lsusb"/><link href="https://foundata.com/en/blog/2024/system-insights-command-line-dmidecode-lspci/?utm_source=feed-atom" rel="related" type="text/html" title="System insights with command-line tools: dmidecode and lspci"/><link href="https://foundata.com/en/blog/2024/cve-2024-6387-regresshion-openssh-rce-vulnerability/?utm_source=feed-atom" rel="related" type="text/html" title="OpenSSH Vulnerability: regreSSHion (CVE-2024-6387), Remote Code Execution (RCE)"/><link href="https://foundata.com/en/blog/2024/quectel-em05-g-thinkpad-t14-gen4-fedora-linux/?utm_source=feed-atom" rel="related" type="text/html" title="Quectel EM05-G (LTE module) with ThinkPad T14 Gen4 on Fedora 39 and 40"/><link href="https://foundata.com/en/blog/2024/use-gpl-or-later/?utm_source=feed-atom" rel="related" type="text/html" title='Please use GPLv3 "or-later" instead of "only"'/><author><name>Andreas Haerter</name><uri>https://andreashaerter.com/</uri></author><summary type="html">An article introducing the command line tools `lsof` and `lsblk`.</summary><content type="html" xml:base="https://foundata.com/"><![CDATA[<p><em>Note: This article was originally released <a href="https://fedoramagazine.org/system-insights-with-command-line-tools-lsof-and-lsblk/" target="_blank" rel="noreferrer noopener">in the Fedora Magazine</a>.</em></p>
<p>In our ongoing series on Linux system insights, we have a look into essential command-line utilities that provide information about the system’s hardware and status. Following our previous discussions on <a href="https://foundata.com/en/blog/2024/system-insights-command-line-lscpu-lsusb/"><code>lscpu</code>, <code>lsusb</code></a>, <a href="https://foundata.com/en/blog/2024/system-insights-command-line-dmidecode-lspci/"><code>dmidecode</code> and <code>lspci</code></a>, we now turn our attention to <code>lsof</code> and <code>lsblk</code>. These tools are particularly useful for investigating open files, active network connections, and mounted block devices on your Fedora Linux system.</p>
<h2 id="exploring-open-files-with-lsof" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#exploring-open-files-with-lsof" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="exploring-open-files-with-lsof">Exploring open files with <code>lsof</code></a></h2><p><code>lsof</code> (list open files) is a powerful command-line tool. Since <a href="https://en.wikipedia.org/wiki/Everything_is_a_file" target="_blank" rel="noreferrer noopener">almost everything in Linux is treated as a file</a>, <code>lsof</code> provides detailed insight into many parts of your system by listing what files are being used, which processes are accessing them, and even which network ports are open (see e.g. Wikipedia on <a href="https://en.wikipedia.org/wiki/Network_socket" target="_blank" rel="noreferrer noopener">Network socket</a> for more information).</p>
<h3 id="basic-usage" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#basic-usage" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="basic-usage">Basic usage</a></h3><p>To start with, execute the basic <code>lsof</code> command to get an overview of the system’s open files:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ sudo lsof
</span></span></code></pre></div><p><code>sudo</code> was used for extended privileges. This is needed to get information about files not opened by processes started by your user. The command outputs a lot of information which can be overwhelming. We are going to narrow down the output to specific information about some common use cases in the following examples.</p>
<h3 id="example-1-finding-open-files-by-user-or-process" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#example-1-finding-open-files-by-user-or-process" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="example-1-finding-open-files-by-user-or-process">Example 1: Finding open files by user or process</a></h3><p>To identify which files a specific user or process has open, <code>lsof</code> can be very helpful.</p>
<p>To list all files opened by a specific user:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ sudo lsof -u &lt;username&gt;
</span></span></code></pre></div><p>This will return a list of open files owned by the given user. For example:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ sudo lsof -u johndoe
</span></span></code></pre></div><p>You’ll see details such as the process ID (PID), the file descriptor, the type of file, and the file’s path.</p>
<p>To filter by process ID, use the <code>-p</code> flag:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ lsof -p &lt;PID&gt;
</span></span></code></pre></div><p>This is particularly useful for troubleshooting issues related to specific processes or when you need to check which files a service is holding open. Use sudo if the process is not owned by your user.</p>
<p>Example output:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ lsof -p <span class="m">873648</span>
</span></span><span class="line"><span class="cl">COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME
</span></span><span class="line"><span class="cl">bash    <span class="m">873648</span> user  cwd    DIR   0,39     <span class="m">8666</span>      <span class="m">257</span> /home/user
</span></span><span class="line"><span class="cl">bash    <span class="m">873648</span> user  rtd    DIR   0,35      <span class="m">158</span>      <span class="m">256</span> /
</span></span><span class="line"><span class="cl">bash    <span class="m">873648</span> user  txt    REG   0,35  <span class="m">1443376</span> <span class="m">12841259</span> /usr/bin/bash
</span></span><span class="line"><span class="cl">bash    <span class="m">873648</span> user  mem    REG   0,33          <span class="m">12841259</span> /usr/bin/bash <span class="o">(</span>path <span class="nv">dev</span><span class="o">=</span>0,35<span class="o">)</span>
</span></span><span class="line"><span class="cl">bash    <span class="m">873648</span> user  mem    REG   0,33          <span class="m">14055145</span> /usr/lib/locale/locale-archive <span class="o">(</span>path <span class="nv">dev</span><span class="o">=</span>0,35<span class="o">)</span>
</span></span><span class="line"><span class="cl">bash    <span class="m">873648</span> user  mem    REG   0,33          <span class="m">14055914</span> /usr/lib64/libc.so.6 <span class="o">(</span>path <span class="nv">dev</span><span class="o">=</span>0,35<span class="o">)</span>
</span></span><span class="line"><span class="cl">bash    <span class="m">873648</span> user  mem    REG   0,33          <span class="m">13309071</span> /usr/lib64/libtinfo.so.6.4 <span class="o">(</span>path <span class="nv">dev</span><span class="o">=</span>0,35<span class="o">)</span>
</span></span><span class="line"><span class="cl">bash    <span class="m">873648</span> user  mem    REG   0,33          <span class="m">14059926</span> /usr/lib64/gconv/gconv-modules.cache <span class="o">(</span>path <span class="nv">dev</span><span class="o">=</span>0,35<span class="o">)</span>
</span></span><span class="line"><span class="cl">bash    <span class="m">873648</span> user  mem    REG   0,33          <span class="m">14055911</span> /usr/lib64/ld-linux-x86-64.so.2 <span class="o">(</span>path <span class="nv">dev</span><span class="o">=</span>0,35<span class="o">)</span>
</span></span><span class="line"><span class="cl">bash    <span class="m">873648</span> user    0u   CHR  136,3      0t0        <span class="m">6</span> /dev/pts/3
</span></span><span class="line"><span class="cl">bash    <span class="m">873648</span> user    1u   CHR  136,3      0t0        <span class="m">6</span> /dev/pts/3
</span></span><span class="line"><span class="cl">bash    <span class="m">873648</span> user    2u   CHR  136,3      0t0        <span class="m">6</span> /dev/pts/3
</span></span><span class="line"><span class="cl">bash    <span class="m">873648</span> user  255u   CHR  136,3      0t0        <span class="m">6</span> /dev/pts/3
</span></span></code></pre></div><h3 id="example-2-identifying-open-network-connections-via-sockets" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#example-2-identifying-open-network-connections-via-sockets" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="example-2-identifying-open-network-connections-via-sockets">Example 2: identifying open network connections via sockets</a></h3><p>With its ability to list network connections, <code>lsof</code> also becomes a handy tool for diagnosing network-related issues as it is usually even available on hardened, minimal systems.</p>
<p>To display all open network connections (TCP/UDP <a href="https://en.wikipedia.org/wiki/Network_socket" target="_blank" rel="noreferrer noopener">sockets</a>), run:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ sudo lsof -i
</span></span></code></pre></div><p>This will list active network connections along with the associated protocol, port, and process details.</p>
<p>You can filter for specific protocols (like TCP or UDP), include or exclude IPv4 and v6 and combine several values (the example section of <code>man lsof</code> provides a lot of useful information, including negation):</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ sudo lsof -i tcp
</span></span><span class="line"><span class="cl">$ sudo lsof -i udp
</span></span><span class="line"><span class="cl">$ sudo lsof -i 4tcp
</span></span><span class="line"><span class="cl">$ sudo lsof -i 6tcp
</span></span><span class="line"><span class="cl">$ sudo lsof -i 4tcp@example.com
</span></span></code></pre></div><p>For connections associated with a particular port:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ sudo lsof -i :&lt;port_number&gt;
</span></span></code></pre></div><p>For example, to list connections to port 22 (SSH):</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ sudo lsof -i :22
</span></span><span class="line"><span class="cl">COMMAND    PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
</span></span><span class="line"><span class="cl">sshd    <span class="m">904379</span> root    3u  IPv4 <span class="m">5622530</span>      0t0  TCP *:ssh <span class="o">(</span>LISTEN<span class="o">)</span>
</span></span><span class="line"><span class="cl">sshd    <span class="m">904379</span> root    4u  IPv6 <span class="m">5622532</span>      0t0  TCP *:ssh <span class="o">(</span>LISTEN<span class="o">)</span>
</span></span></code></pre></div><p>This information can be critical for identifying unauthorized connections or simply monitoring network activity on a system for debugging.</p>
<h2 id="investigating-block-devices-with-lsblk" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#investigating-block-devices-with-lsblk" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="investigating-block-devices-with-lsblk">Investigating block devices with <code>lsblk</code></a></h2><p>Another useful tool is <code>lsblk</code>, which displays information about all available <a href="https://en.wikipedia.org/wiki/Device_file#Block_devices" target="_blank" rel="noreferrer noopener">block devices</a> on your system. Block devices include hard drives, SSDs, and USB storage. This command provides a tree-like view, helping you understand the relationships between partitions, devices, and their mount points.</p>
<h3 id="basic-usage-1" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#basic-usage-1" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="basic-usage-1">Basic usage</a></h3><p>Running <code>lsblk</code> without any options provides a clean hierarchical structure of the block devices:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ lsblk
</span></span></code></pre></div><p>This shows all block devices in a tree structure, including their size, type (disk, partition), and mount point (if applicable).</p>
<h3 id="examples" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#examples" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="examples">Examples</a></h3><p>For a deeper look into the file systems on your block devices, use the -f flag:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ lsblk -f
</span></span></code></pre></div><p>This will display not just the block devices, but also details about the file systems on each partition, including the type (e.g., ext4, vfat, swap), the UUID, and the current mount points.</p>
<p>If you want less information about the devices themselves (without showing partitions or mount points), the -d option is useful:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ lsblk -d
</span></span></code></pre></div><p>There is also a -J or –json option. If used, the command outputs the information in JSON format. This provides a structured view that is particularly useful for scripting and automation.</p>
<p>Example outputs from my laptop (some long information like UUIDs stripped for readability):</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ lsblk
</span></span><span class="line"><span class="cl">NAME                     MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
</span></span><span class="line"><span class="cl">sda                        8:0    <span class="m">1</span>     0B  <span class="m">0</span> disk
</span></span><span class="line"><span class="cl">sdb                        8:16   <span class="m">1</span>     0B  <span class="m">0</span> disk
</span></span><span class="line"><span class="cl">sdc                        8:32   <span class="m">1</span>     0B  <span class="m">0</span> disk
</span></span><span class="line"><span class="cl">zram0                    252:0    <span class="m">0</span>     8G  <span class="m">0</span> disk  <span class="o">[</span>SWAP<span class="o">]</span>
</span></span><span class="line"><span class="cl">nvme0n1                  259:0    <span class="m">0</span> 931,5G  <span class="m">0</span> disk
</span></span><span class="line"><span class="cl">├─nvme0n1p1              259:1    <span class="m">0</span>   600M  <span class="m">0</span> part  /boot/efi
</span></span><span class="line"><span class="cl">├─nvme0n1p2              259:2    <span class="m">0</span>     1G  <span class="m">0</span> part  /boot
</span></span><span class="line"><span class="cl">└─nvme0n1p3              259:3    <span class="m">0</span> 929,9G  <span class="m">0</span> part
</span></span><span class="line"><span class="cl">  └─luks-84257c20<span class="o">[</span>...<span class="o">]</span>   253:0    <span class="m">0</span> 929,9G  <span class="m">0</span> crypt /home
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">$ lsblk -d
</span></span><span class="line"><span class="cl">NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
</span></span><span class="line"><span class="cl">sda       8:0    <span class="m">1</span>     0B  <span class="m">0</span> disk
</span></span><span class="line"><span class="cl">sdb       8:16   <span class="m">1</span>     0B  <span class="m">0</span> disk
</span></span><span class="line"><span class="cl">sdc       8:32   <span class="m">1</span>     0B  <span class="m">0</span> disk
</span></span><span class="line"><span class="cl">zram0   252:0    <span class="m">0</span>     8G  <span class="m">0</span> disk <span class="o">[</span>SWAP<span class="o">]</span>
</span></span><span class="line"><span class="cl">nvme0n1 259:0    <span class="m">0</span> 931,5G  <span class="m">0</span> disk
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">$ lsblk -f
</span></span><span class="line"><span class="cl">NAME                FSTYPE <span class="o">[</span>...<span class="o">]</span>LABEL    UUID           FSAVAIL FSUSE% MOUNTPOINTS
</span></span><span class="line"><span class="cl">sda
</span></span><span class="line"><span class="cl">sdb
</span></span><span class="line"><span class="cl">sdc
</span></span><span class="line"><span class="cl">zram0                                                                  <span class="o">[</span>SWAP<span class="o">]</span>
</span></span><span class="line"><span class="cl">nvme0n1
</span></span><span class="line"><span class="cl">├─nvme0n1p1         vfat                 4C5B-4355      579,7M  3%     /boot/efi
</span></span><span class="line"><span class="cl">├─nvme0n1p2         ext4                 30eff827<span class="o">[</span>...<span class="o">]</span>  605M    31%    /boot
</span></span><span class="line"><span class="cl">└─nvme0n1p3         crypto_LUKS          84257c20<span class="o">[</span>...<span class="o">]</span>
</span></span><span class="line"><span class="cl">  └─luks-84257<span class="o">[</span>...<span class="o">]</span> btrfs       fe<span class="o">[</span>...<span class="o">]</span>  666f9d6f<span class="o">[</span>...<span class="o">]</span>  303,1G  67%    /home
</span></span><span class="line"><span class="cl">                                                                       /
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">$ lsblk -f -J
</span></span><span class="line"><span class="cl"><span class="o">{</span>
</span></span><span class="line"><span class="cl">   <span class="s2">&#34;blockdevices&#34;</span>: <span class="o">[</span>
</span></span><span class="line"><span class="cl">   <span class="o">[</span>...<span class="o">]</span>,<span class="o">{</span>
</span></span><span class="line"><span class="cl">         <span class="s2">&#34;name&#34;</span>: <span class="s2">&#34;nvme0n1&#34;</span>,
</span></span><span class="line"><span class="cl">         <span class="s2">&#34;fstype&#34;</span>: null,
</span></span><span class="line"><span class="cl">         <span class="s2">&#34;fsver&#34;</span>: null,
</span></span><span class="line"><span class="cl">         <span class="s2">&#34;label&#34;</span>: null,
</span></span><span class="line"><span class="cl">         <span class="s2">&#34;uuid&#34;</span>: null,
</span></span><span class="line"><span class="cl">         <span class="s2">&#34;fsavail&#34;</span>: null,
</span></span><span class="line"><span class="cl">         <span class="s2">&#34;fsuse%&#34;</span>: null,
</span></span><span class="line"><span class="cl">         <span class="s2">&#34;mountpoints&#34;</span>: <span class="o">[</span>
</span></span><span class="line"><span class="cl">             null
</span></span><span class="line"><span class="cl">         <span class="o">]</span>,
</span></span><span class="line"><span class="cl">         <span class="s2">&#34;children&#34;</span>: <span class="o">[</span>
</span></span><span class="line"><span class="cl">            <span class="o">{</span>
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;name&#34;</span>: <span class="s2">&#34;nvme0n1p1&#34;</span>,
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;fstype&#34;</span>: <span class="s2">&#34;vfat&#34;</span>,
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;fsver&#34;</span>: <span class="s2">&#34;FAT32&#34;</span>,
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;label&#34;</span>: null,
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;uuid&#34;</span>: <span class="s2">&#34;4C5B-4355&#34;</span>,
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;fsavail&#34;</span>: <span class="s2">&#34;579,7M&#34;</span>,
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;fsuse%&#34;</span>: <span class="s2">&#34;3%&#34;</span>,
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;mountpoints&#34;</span>: <span class="o">[</span>
</span></span><span class="line"><span class="cl">                   <span class="s2">&#34;/boot/efi&#34;</span>
</span></span><span class="line"><span class="cl">               <span class="o">]</span>
</span></span><span class="line"><span class="cl">            <span class="o">}</span>,<span class="o">{</span>
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;name&#34;</span>: <span class="s2">&#34;nvme0n1p2&#34;</span>,
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;fstype&#34;</span>: <span class="s2">&#34;ext4&#34;</span>,
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;fsver&#34;</span>: <span class="s2">&#34;1.0&#34;</span>,
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;label&#34;</span>: null,
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;uuid&#34;</span>: <span class="s2">&#34;30eff827-[...]&#34;</span>,
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;fsavail&#34;</span>: <span class="s2">&#34;605M&#34;</span>,
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;fsuse%&#34;</span>: <span class="s2">&#34;31%&#34;</span>,
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;mountpoints&#34;</span>: <span class="o">[</span>
</span></span><span class="line"><span class="cl">                   <span class="s2">&#34;/boot&#34;</span>
</span></span><span class="line"><span class="cl">               <span class="o">]</span>
</span></span><span class="line"><span class="cl">            <span class="o">}</span>,<span class="o">{</span>
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;name&#34;</span>: <span class="s2">&#34;nvme0n1p3&#34;</span>,
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;fstype&#34;</span>: <span class="s2">&#34;crypto_LUKS&#34;</span>,
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;fsver&#34;</span>: <span class="s2">&#34;2&#34;</span>,
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;label&#34;</span>: null,
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;uuid&#34;</span>: <span class="s2">&#34;84257c20-[...]&#34;</span>,
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;fsavail&#34;</span>: null,
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;fsuse%&#34;</span>: null,
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;mountpoints&#34;</span>: <span class="o">[</span>
</span></span><span class="line"><span class="cl">                   null
</span></span><span class="line"><span class="cl">               <span class="o">]</span>,
</span></span><span class="line"><span class="cl">               <span class="s2">&#34;children&#34;</span>: <span class="o">[</span>
</span></span><span class="line"><span class="cl">                  <span class="o">{</span>
</span></span><span class="line"><span class="cl">                     <span class="s2">&#34;name&#34;</span>: <span class="s2">&#34;luks-[...]&#34;</span>,
</span></span><span class="line"><span class="cl">                     <span class="s2">&#34;fstype&#34;</span>: <span class="s2">&#34;btrfs&#34;</span>,
</span></span><span class="line"><span class="cl">                     <span class="s2">&#34;fsver&#34;</span>: null,
</span></span><span class="line"><span class="cl">                     <span class="s2">&#34;label&#34;</span>: <span class="s2">&#34;fedora_localhost-live&#34;</span>,
</span></span><span class="line"><span class="cl">                     <span class="s2">&#34;uuid&#34;</span>: <span class="s2">&#34;666f9d6f-[...]&#34;</span>,
</span></span><span class="line"><span class="cl">                     <span class="s2">&#34;fsavail&#34;</span>: <span class="s2">&#34;303,1G&#34;</span>,
</span></span><span class="line"><span class="cl">                     <span class="s2">&#34;fsuse%&#34;</span>: <span class="s2">&#34;67%&#34;</span>,
</span></span><span class="line"><span class="cl">                     <span class="s2">&#34;mountpoints&#34;</span>: <span class="o">[</span>
</span></span><span class="line"><span class="cl">                         <span class="s2">&#34;/home&#34;</span>, <span class="s2">&#34;/&#34;</span>
</span></span><span class="line"><span class="cl">                     <span class="o">]</span>
</span></span><span class="line"><span class="cl">                  <span class="o">}</span>
</span></span><span class="line"><span class="cl">               <span class="o">]</span>
</span></span><span class="line"><span class="cl">            <span class="o">}</span>
</span></span><span class="line"><span class="cl">         <span class="o">]</span>
</span></span><span class="line"><span class="cl">      <span class="o">}</span>
</span></span><span class="line"><span class="cl">   <span class="o">]</span>
</span></span><span class="line"><span class="cl"><span class="o">}</span>
</span></span></code></pre></div><h3 id="conclusion" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#conclusion" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="conclusion">Conclusion</a></h3><p>The <code>lsof</code> and <code>lsblk</code> commands are providing insights into file usage, network activity, and block device structures. Whether you’re tracking down open file handles, diagnosing network connections, or reviewing storage devices; whether you’re troubleshooting, optimizing, or simply curious; these tools provide valuable data that can help you better understand and manage your Fedora Linux environment. See you next time when we will have a look at more useful listing and information command line tools and how to use them.</p>
]]></content><category scheme="taxonomy:tags" term="toolbox" label="toolbox"/><category scheme="taxonomy:tags" term="lsof" label="lsof"/><category scheme="taxonomy:tags" term="lsblk" label="lsblk"/></entry><entry><title type="html">System insights with command-line tools: dmidecode and lspci</title><id>tag:foundata.com,2024-07-10:/en/blog/2024/system-insights-command-line-dmidecode-lspci/</id><published>2024-07-10T22:25:00Z</published><updated>2024-07-10T22:25:00Z</updated><link href="https://foundata.com/en/blog/2024/system-insights-command-line-dmidecode-lspci/?utm_source=feed-atom" rel="alternate" type="text/html"/><link href="https://foundata.com/de/blog/2024/systemeinblicke-kommandozeile-dmidecode-lspci/?utm_source=feed-atom" rel="alternate" type="text/html" hreflang="de"/><link href="https://foundata.com/en/blog/2024/system-insights-command-line-lscpu-lsusb/?utm_source=feed-atom" rel="related" type="text/html" title="System insights with command-line tools: lscpu and lsusb"/><author><name>Andreas Haerter</name><uri>https://andreashaerter.com/</uri></author><summary type="html">An article introducing the command line tools `dmidecode` and `lspci`.</summary><content type="html" xml:base="https://foundata.com/"><![CDATA[<p><em>Note: This article was originally released <a href="https://fedoramagazine.org/system-insights-command-line-dmidecode-lspci/" target="_blank" rel="noreferrer noopener">in the Fedora Magazine</a>.</em></p>
<p>In our ongoing series on Linux system insights, we have a look into essential command-line utilities that provide information about the system&rsquo;s hardware and status. Following our previous <a href="https://foundata.com/en/blog/2024/system-insights-command-line-lscpu-lsusb/">discussion on <code>lscpu</code> and <code>lsusb</code></a>, we now turn our attention to <code>dmidecode</code> and <code>lspci</code>.</p>
<h2 id="dmidecode--decoding-your-systems-dmi-table" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#dmidecode--decoding-your-systems-dmi-table" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="dmidecode--decoding-your-systems-dmi-table"><code>dmidecode</code> – Decoding your system&rsquo;s DMI table</a></h2><p><code>dmidecode</code> is a command-line utility for retrieving detailed information about the system hardware. It reads the <a href="https://en.wikipedia.org/wiki/Desktop_Management_Interface" target="_blank" rel="noreferrer noopener">DMI (Desktop Management Interface)</a> table, which contains data provided by the system&rsquo;s firmware. This data includes details about the system&rsquo;s BIOS, processor, memory, and other hardware components. Using <code>dmidecode</code>, you can gain insights into the hardware configuration without the need to be on-site or opening the system case. The binary is provided by the <code>util-linux</code> package on Red Hat platforms like Fedora Linux.</p>
<h3 id="basic-usage" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#basic-usage" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="basic-usage">Basic usage</a></h3><p>To start with, let&rsquo;s execute the basic <code>dmidecode</code> command to get an overview of the system&rsquo;s DMI table:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ sudo dmidecode
</span></span></code></pre></div><p>This command outputs a comprehensive list of DMI table entries, which can be overwhelming.</p>
<p>To narrow down the output to specific information, you can use various options, especially via defining a type with <code>-t number</code>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ sudo dmidecode -t number
</span></span></code></pre></div><p>where <code>number</code> is an integer. The following is from <code>man dmidecode</code>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="o">[</span>... output omitted <span class="k">for</span> readability ...<span class="o">]</span>
</span></span><span class="line"><span class="cl">The SMBIOS specification defines the following DMI types:
</span></span><span class="line"><span class="cl">Type   Information
</span></span><span class="line"><span class="cl">────────────────────────────────────────────
</span></span><span class="line"><span class="cl">  <span class="m">0</span>   BIOS
</span></span><span class="line"><span class="cl">  <span class="m">1</span>   System
</span></span><span class="line"><span class="cl">  <span class="m">2</span>   Baseboard
</span></span><span class="line"><span class="cl">  <span class="m">3</span>   Chassis
</span></span><span class="line"><span class="cl">  <span class="m">4</span>   Processor
</span></span><span class="line"><span class="cl">  <span class="m">5</span>   Memory Controller
</span></span><span class="line"><span class="cl">  <span class="m">6</span>   Memory Module
</span></span><span class="line"><span class="cl">  <span class="m">7</span>   Cache
</span></span><span class="line"><span class="cl">  <span class="m">8</span>   Port Connector
</span></span><span class="line"><span class="cl">  <span class="m">9</span>   System Slots
</span></span><span class="line"><span class="cl">  <span class="m">10</span>   On Board Devices
</span></span><span class="line"><span class="cl">  <span class="m">11</span>   OEM Strings
</span></span><span class="line"><span class="cl">  <span class="m">12</span>   System Configuration Options
</span></span><span class="line"><span class="cl">  <span class="m">13</span>   BIOS Language
</span></span><span class="line"><span class="cl">  <span class="m">14</span>   Group Associations
</span></span><span class="line"><span class="cl">  <span class="m">15</span>   System Event Log
</span></span><span class="line"><span class="cl">  <span class="m">16</span>   Physical Memory Array
</span></span><span class="line"><span class="cl">  <span class="m">17</span>   Memory Device
</span></span><span class="line"><span class="cl">  <span class="m">18</span>   32-bit Memory Error
</span></span><span class="line"><span class="cl">  <span class="m">19</span>   Memory Array Mapped Address
</span></span><span class="line"><span class="cl">  <span class="m">20</span>   Memory Device Mapped Address
</span></span><span class="line"><span class="cl">  <span class="m">21</span>   Built-in Pointing Device
</span></span><span class="line"><span class="cl">  <span class="m">22</span>   Portable Battery
</span></span><span class="line"><span class="cl">  <span class="m">23</span>   System Reset
</span></span><span class="line"><span class="cl">  <span class="m">24</span>   Hardware Security
</span></span><span class="line"><span class="cl">  <span class="m">25</span>   System Power Controls
</span></span><span class="line"><span class="cl">  <span class="m">26</span>   Voltage Probe
</span></span><span class="line"><span class="cl">  <span class="m">27</span>   Cooling Device
</span></span><span class="line"><span class="cl">  <span class="m">28</span>   Temperature Probe
</span></span><span class="line"><span class="cl">  <span class="m">29</span>   Electrical Current Probe
</span></span><span class="line"><span class="cl">  <span class="m">30</span>   Out-of-band Remote Access
</span></span><span class="line"><span class="cl">  <span class="m">31</span>   Boot Integrity Services
</span></span><span class="line"><span class="cl">  <span class="m">32</span>   System Boot
</span></span><span class="line"><span class="cl">  <span class="m">33</span>   64-bit Memory Error
</span></span><span class="line"><span class="cl">  <span class="m">34</span>   Management Device
</span></span><span class="line"><span class="cl">  <span class="m">35</span>   Management Device Component
</span></span><span class="line"><span class="cl">  <span class="m">36</span>   Management Device Threshold Data
</span></span><span class="line"><span class="cl">  <span class="m">37</span>   Memory Channel
</span></span><span class="line"><span class="cl">  <span class="m">38</span>   IPMI Device
</span></span><span class="line"><span class="cl">  <span class="m">39</span>   Power Supply
</span></span><span class="line"><span class="cl">  <span class="m">40</span>   Additional Information
</span></span><span class="line"><span class="cl">  <span class="m">41</span>   Onboard Devices Extended Information
</span></span><span class="line"><span class="cl">  <span class="m">42</span>   Management Controller Host Interface
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">Additionally, <span class="nb">type</span> <span class="m">126</span> is used <span class="k">for</span> disabled entries and <span class="nb">type</span> <span class="m">127</span> is an end-of-table marker. Types <span class="m">128</span> to <span class="m">255</span> are <span class="k">for</span> OEM-specific data.  dmidecode will display these entries by default, but it can only decode them when the vendors have contributed documentation or code <span class="k">for</span> them.
</span></span><span class="line"><span class="cl"><span class="o">[</span>... output omitted <span class="k">for</span> readability ...<span class="o">]</span>
</span></span></code></pre></div><h3 id="example-1-retrieving-bios-information" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#example-1-retrieving-bios-information" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="example-1-retrieving-bios-information">Example 1: Retrieving BIOS information</a></h3><p>To fetch details about the BIOS, use the <code>-t</code> option followed by the type number for BIOS information (type <code>0</code>):</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ sudo dmidecode -t <span class="m">0</span>
</span></span></code></pre></div><p>This command outputs information such as the BIOS version, release date, and vendor. Example output (here using a ThinkPad T480S):</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ sudo dmidecode -t <span class="m">0</span>
</span></span><span class="line"><span class="cl"><span class="c1"># dmidecode 3.6</span>
</span></span><span class="line"><span class="cl">Getting SMBIOS data from sysfs.
</span></span><span class="line"><span class="cl">SMBIOS 3.0.0 present.
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">Handle 0x000B, DMI <span class="nb">type</span> 0, <span class="m">24</span> bytes
</span></span><span class="line"><span class="cl">BIOS Information
</span></span><span class="line"><span class="cl">    Vendor: LENOVO
</span></span><span class="line"><span class="cl">    Version: N22ET80W <span class="o">(</span>1.57 <span class="o">)</span>
</span></span><span class="line"><span class="cl">    Release Date: 02/27/2024
</span></span><span class="line"><span class="cl">    Address: 0xE0000
</span></span><span class="line"><span class="cl">    Runtime Size: <span class="m">128</span> kB
</span></span><span class="line"><span class="cl">    ROM Size: <span class="m">16</span> MB
</span></span><span class="line"><span class="cl">    Characteristics:
</span></span><span class="line"><span class="cl">        PCI is supported
</span></span><span class="line"><span class="cl">        PNP is supported
</span></span><span class="line"><span class="cl">        BIOS is upgradeable
</span></span><span class="line"><span class="cl">        BIOS shadowing is allowed
</span></span><span class="line"><span class="cl">        Boot from CD is supported
</span></span><span class="line"><span class="cl">        Selectable boot is supported
</span></span><span class="line"><span class="cl">        EDD is supported
</span></span><span class="line"><span class="cl">        3.5<span class="s2">&#34;/720 kB floppy services are supported (int 13h)
</span></span></span><span class="line"><span class="cl"><span class="s2">        Print screen service is supported (int 5h)
</span></span></span><span class="line"><span class="cl"><span class="s2">        8042 keyboard services are supported (int 9h)
</span></span></span><span class="line"><span class="cl"><span class="s2">        Serial services are supported (int 14h)
</span></span></span><span class="line"><span class="cl"><span class="s2">        Printer services are supported (int 17h)
</span></span></span><span class="line"><span class="cl"><span class="s2">        CGA/mono video services are supported (int 10h)
</span></span></span><span class="line"><span class="cl"><span class="s2">        ACPI is supported
</span></span></span><span class="line"><span class="cl"><span class="s2">        USB legacy is supported
</span></span></span><span class="line"><span class="cl"><span class="s2">        BIOS boot specification is supported
</span></span></span><span class="line"><span class="cl"><span class="s2">        Targeted content distribution is supported
</span></span></span><span class="line"><span class="cl"><span class="s2">        UEFI is supported
</span></span></span><span class="line"><span class="cl"><span class="s2">    BIOS Revision: 1.57
</span></span></span><span class="line"><span class="cl"><span class="s2">    Firmware Revision: 1.23
</span></span></span></code></pre></div><h3 id="example-2-extracting-baseboard-mainboard-and-memory-information" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#example-2-extracting-baseboard-mainboard-and-memory-information" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="example-2-extracting-baseboard-mainboard-and-memory-information">Example 2: Extracting baseboard (mainboard) and memory information</a></h3><p>For specific details about memory, you can query baseboard type <code>2</code> and memory device type <code>17</code>. This will provide details about the system&rsquo;s memory modules, including size, speed, and manufacturer.</p>
<p>This information is particularly useful when upgrading or troubleshooting system memory or if you need to buy additional, compatible RAM for a server you did not provide by yourself.</p>
<p>A real world example of a small labserver with four memory sticks:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ sudo dmidecode -t 2,17
</span></span><span class="line"><span class="cl"><span class="o">[</span>... output omitted <span class="k">for</span> readability ...<span class="o">]</span>
</span></span><span class="line"><span class="cl">    Manufacturer: Supermicro
</span></span><span class="line"><span class="cl">    Product Name: X11SPL-F
</span></span><span class="line"><span class="cl">    Version: 1.02
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="o">[</span>... output omitted <span class="k">for</span> readability ...<span class="o">]</span>
</span></span><span class="line"><span class="cl">Handle 0x0029, DMI <span class="nb">type</span> 17, <span class="m">84</span> bytes
</span></span><span class="line"><span class="cl">Memory Device
</span></span><span class="line"><span class="cl">    Array Handle: 0x0025
</span></span><span class="line"><span class="cl">    Error Information Handle: Not Provided
</span></span><span class="line"><span class="cl">    Total Width: <span class="m">72</span> bits
</span></span><span class="line"><span class="cl">    Data Width: <span class="m">64</span> bits
</span></span><span class="line"><span class="cl">    Size: <span class="m">64</span> GB
</span></span><span class="line"><span class="cl">    Form Factor: DIMM
</span></span><span class="line"><span class="cl">    Set: None
</span></span><span class="line"><span class="cl">    Locator: DIMMB1
</span></span><span class="line"><span class="cl">    Bank Locator: P0_Node0_Channel1_Dimm0
</span></span><span class="line"><span class="cl">    Type: DDR4
</span></span><span class="line"><span class="cl">    Type Detail: Synchronous Registered <span class="o">(</span>Buffered<span class="o">)</span>
</span></span><span class="line"><span class="cl">    Speed: <span class="m">2933</span> MT/s
</span></span><span class="line"><span class="cl">    Manufacturer: Samsung
</span></span><span class="line"><span class="cl">    Serial Number: 167D51E1
</span></span><span class="line"><span class="cl">    Asset Tag: DIMMB1_AssetTag <span class="o">(</span>date:22/38<span class="o">)</span>
</span></span><span class="line"><span class="cl">    Part Number: M393A8G40MB2-CVF
</span></span><span class="line"><span class="cl">    Rank: <span class="m">2</span>
</span></span><span class="line"><span class="cl">    Configured Memory Speed: <span class="m">2400</span> MT/s
</span></span><span class="line"><span class="cl">    Minimum Voltage: 1.2 V
</span></span><span class="line"><span class="cl">    Maximum Voltage: 1.2 V
</span></span><span class="line"><span class="cl">    Configured Voltage: 1.2 V
</span></span><span class="line"><span class="cl">    Memory Technology: DRAM
</span></span><span class="line"><span class="cl">    Memory Operating Mode Capability: Volatile memory
</span></span><span class="line"><span class="cl">    Firmware Version: <span class="m">0000</span>
</span></span><span class="line"><span class="cl">    Module Manufacturer ID: Bank 1, Hex 0xCE
</span></span><span class="line"><span class="cl">    Module Product ID: Unknown
</span></span><span class="line"><span class="cl">    Memory Subsystem Controller Manufacturer ID: Unknown
</span></span><span class="line"><span class="cl">    Memory Subsystem Controller Product ID: Unknown
</span></span><span class="line"><span class="cl">    Non-Volatile Size: None
</span></span><span class="line"><span class="cl">    Volatile Size: <span class="m">64</span> GB
</span></span><span class="line"><span class="cl">    Cache Size: None
</span></span><span class="line"><span class="cl">    Logical Size: None
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">$ sudo dmidecode -t <span class="m">17</span> <span class="p">|</span> grep -E <span class="s2">&#34;(Manufacturer|Part Number):&#34;</span>
</span></span><span class="line"><span class="cl">    Manufacturer: Samsung
</span></span><span class="line"><span class="cl">    Part Number: M393A8G40MB2-CVF
</span></span><span class="line"><span class="cl">    Manufacturer: Samsung
</span></span><span class="line"><span class="cl">    Part Number: M393A8G40MB2-CVF
</span></span><span class="line"><span class="cl">    Manufacturer: Samsung
</span></span><span class="line"><span class="cl">    Part Number: M393A8G40MB2-CVF
</span></span><span class="line"><span class="cl">    Manufacturer: Samsung
</span></span><span class="line"><span class="cl">    Part Number: M393A8G40MB2-CVF
</span></span></code></pre></div><p>By using this simple command, it is easy to determine what hardware is in use. This information is particularly useful when there is a need for upgrading or replacing hardware.</p>
<h2 id="lspci-listing-pci-devices" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#lspci-listing-pci-devices" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="lspci-listing-pci-devices"><code>lspci</code>: Listing PCI devices</a></h2><p>The <code>lspci</code> command is used to list all <a href="https://en.wikipedia.org/wiki/Peripheral_Component_Interconnect" target="_blank" rel="noreferrer noopener">PCI (Peripheral Component Interconnect)</a> devices in the system. PCI devices include network cards, graphics cards, USB controllers, and more. This command provides a snapshot of the devices connected to the system&rsquo;s PCI bus, offering a detailed view of their configuration and status.</p>
<p>Unlike <code>dmidecode</code>, <code>lspci</code> does not need extended privileges, a common user is enough to determine useful information.</p>
<h3 id="basic-usage-1" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#basic-usage-1" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="basic-usage-1">Basic usage</a></h3><p>A simple execution of the <code>lspci</code> command lists all PCI devices:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ lspci
</span></span></code></pre></div><p>For more detailed information about the devices, you can use the <code>-v</code> (verbose) option:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ lspci -v
</span></span></code></pre></div><h3 id="example-1-finding-graphics-card-information" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#example-1-finding-graphics-card-information" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="example-1-finding-graphics-card-information">Example 1: Finding graphics card information</a></h3><p>To find more information about the system&rsquo;s graphics card, you can filter the <code>lspci</code> output using <code>grep</code>. Example output (here using a ThinkPad T480S):</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ lspci <span class="p">|</span> grep -i vga
</span></span><span class="line"><span class="cl">00:02.0 VGA compatible controller: Intel Corporation UHD Graphics <span class="m">620</span> <span class="o">(</span>rev 07<span class="o">)</span>
</span></span></code></pre></div><h3 id="example-2-check-which-kernel-driver-is-used-by-your-hardware" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#example-2-check-which-kernel-driver-is-used-by-your-hardware" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="example-2-check-which-kernel-driver-is-used-by-your-hardware">Example 2: Check which Kernel driver is used by your hardware</a></h3><p>To see which kernel driver and module is being used by a specific device, you can use the <code>-k</code> option. This lists the kernel driver in use for each PCI device, which can be useful for troubleshooting driver-related issues, especially by being able to do a web search for problems using the driver&rsquo;s name and your hardware model.</p>
<p>Example output (here using a ThinkPad T480S):</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ lspci -k
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="o">[</span>... output omitted <span class="k">for</span> readability ...<span class="o">]</span>
</span></span><span class="line"><span class="cl">00:02.0 VGA compatible controller: Intel Corporation UHD Graphics <span class="m">620</span> <span class="o">(</span>rev 07<span class="o">)</span>
</span></span><span class="line"><span class="cl">    Subsystem: Lenovo Device <span class="m">2258</span>
</span></span><span class="line"><span class="cl">    Kernel driver in use: i915
</span></span><span class="line"><span class="cl">    Kernel modules: i915
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="o">[</span>... output omitted <span class="k">for</span> readability ...<span class="o">]</span>
</span></span><span class="line"><span class="cl">00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection <span class="o">(</span>4<span class="o">)</span> I219-V <span class="o">(</span>rev 21<span class="o">)</span>
</span></span><span class="line"><span class="cl">    Subsystem: Lenovo Device <span class="m">2258</span>
</span></span><span class="line"><span class="cl">    Kernel driver in use: e1000e
</span></span><span class="line"><span class="cl">    Kernel modules: e1000e
</span></span><span class="line"><span class="cl"><span class="o">[</span>... output omitted <span class="k">for</span> readability ...<span class="o">]</span>
</span></span></code></pre></div><p>As you can see, the graphics card is using the <a href="https://www.kernel.org/doc/html/latest/gpu/i915.html" target="_blank" rel="noreferrer noopener">drm/i915 Intel GFX Driver</a> driver and the network card is utilizing <a href="https://www.kernel.org/doc/Documentation/networking/e1000e.txt" target="_blank" rel="noreferrer noopener">e1000e</a>.</p>
<h2 id="conclusion" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#conclusion" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="conclusion">Conclusion</a></h2><p>The <code>dmidecode</code> and <code>lspci</code> commands are powerful tools for extracting detailed hardware information from a Linux system. Even though they are simple, both commands offer insights into the system’s configuration and status. Whether you’re troubleshooting, optimizing, or simply curious, these tools provide valuable data that can help you better understand and manage your Linux environment. See you next time when we will have a look at more useful listing and information command line tools and how to use them.</p>
]]></content><category scheme="taxonomy:tags" term="toolbox" label="toolbox"/><category scheme="taxonomy:tags" term="dmidecode" label="dmidecode"/><category scheme="taxonomy:tags" term="lspci" label="lspci"/></entry><entry><title type="html">System insights with command-line tools: lscpu and lsusb</title><id>tag:foundata.com,2024-05-29:/en/blog/2024/system-insights-command-line-lscpu-lsusb/</id><published>2024-05-29T00:02:00Z</published><updated>2024-05-29T00:02:00Z</updated><link href="https://foundata.com/en/blog/2024/system-insights-command-line-lscpu-lsusb/?utm_source=feed-atom" rel="alternate" type="text/html"/><link href="https://foundata.com/de/blog/2024/systemeinblicke-kommandozeile-lscpu-lsusb/?utm_source=feed-atom" rel="alternate" type="text/html" hreflang="de"/><link href="https://foundata.com/en/blog/2024/quectel-em05-g-thinkpad-t14-gen4-fedora-linux/?utm_source=feed-atom" rel="related" type="text/html" title="Quectel EM05-G (LTE module) with ThinkPad T14 Gen4 on Fedora 39 and 40"/><link href="https://foundata.com/en/blog/2024/use-gpl-or-later/?utm_source=feed-atom" rel="related" type="text/html" title='Please use GPLv3 "or-later" instead of "only"'/><link href="https://foundata.com/en/blog/2024/aten-cv211-kvm-linux/?utm_source=feed-atom" rel="related" type="text/html" title="Using the ATEN CV211 (all-in-one KVM adapter) with Fedora Linux"/><link href="https://foundata.com/en/blog/2024/copyleft-open-source-licenses/?utm_source=feed-atom" rel="related" type="text/html" title="Use copyleft licenses for open source or life with the consequences"/><author><name>Andreas Haerter</name><uri>https://andreashaerter.com/</uri></author><summary type="html">An article introducing the command line tools `lscpu` and `lsusb`.</summary><content type="html" xml:base="https://foundata.com/"><![CDATA[<p><em>Note: This article was originally released <a href="https://fedoramagazine.org/system-insights-with-command-line-tools-lscpu-and-lsusb/" target="_blank" rel="noreferrer noopener">in the Fedora Magazine</a>.</em></p>
<p>Fedora (and other common Linux setups out there) offers you an array of tools for managing, monitoring, and understanding the system. Among these tools are a series of commands that begin with ls (for &ldquo;list&rdquo;).</p>
<p>They provide easy insights into various aspects of the system&rsquo;s hardware and resources. This article series gives you an intro and overview over many of them, starting with the simpler ones. The post will cover <code>lscpu</code> and <code>lsusb</code>.</p>
<h2 id="lscpu--display-cpu-information" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#lscpu--display-cpu-information" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="lscpu--display-cpu-information"><code>lscpu</code> – Display CPU information</a></h2><p>The <code>lscpu</code> command gathers and displays information about the CPU architecture. It is provided by the util-linux package. The command gathers CPU information from multiple sources like <code>/proc/cpuinfo</code> and architecture-specific libraries (e.g. <code>librtas</code> on PowerPC):</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ lscpu
</span></span></code></pre></div><p>This command outputs information like the number of CPUs, threads per core, cores per socket, and the CPU family and model.</p>
<p>If asked, it outputs detailed CPU information in JSON format. This provides a structured view that is particularly useful for scripting and automation:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ lscpu --extended --json
</span></span></code></pre></div><h3 id="advanced-usage-example" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#advanced-usage-example" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="advanced-usage-example">Advanced usage example</a></h3><p>With the machine readable JSON output, you can extract information using <a href="https://jqlang.github.io/jq/" target="_blank" rel="noreferrer noopener"><code>jq</code></a> (a powerful command-line tool that allows users to parse, filter, and manipulate JSON data efficiently and worth an article of its own). For example, the following command will extract the current <a href="https://en.wikipedia.org/wiki/Hertz" target="_blank" rel="noreferrer noopener">MHz</a> for each CPU:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">export</span> <span class="nv">LANG</span><span class="o">=</span>en_US.UTF-8
</span></span><span class="line"><span class="cl"><span class="nb">export</span> <span class="nv">LC_ALL</span><span class="o">=</span><span class="s2">&#34;en_US.UTF-8&#34;</span>
</span></span><span class="line"><span class="cl">lscpu --json --extended <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span>  <span class="p">|</span> jq <span class="s1">&#39;.cpus[] | {cpu: .cpu, mhz: .mhz}&#39;</span>
</span></span></code></pre></div><p>Let&rsquo;s look at the single parts of the command:</p>
<ul>
<li><code>export LANG=en_US.UTF-8</code> and export <code>LC_ALL=&quot;en_US.UTF-8&quot;</code> are making sure that the output is not using localized numbers. For example, a German language setting can result in broken JSON output because of the use of commas in place of periods as floating point separators.</li>
<li><code>lscpu --json --extended</code> generates the detailed CPU information in JSON format.</li>
<li><code>jq '.cpus[] |</code> will iterate over each entry in the cpus array. The <code>{cpu: .cpu, mhz: .mhz}'</code> part constructs a new JSON object for each CPU entry showing the CPU number (<code>cpu</code>) and its current frequency in MHz (<code>mhz</code>).</li>
</ul>
<p>Example output from a laptop operating in performance mode:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ lscpu --json --extended <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span>  <span class="p">|</span> jq <span class="s1">&#39;.cpus[] | {cpu: .cpu, mhz: .mhz}&#39;</span>
</span></span><span class="line"><span class="cl"><span class="o">{</span>
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;cpu&#34;</span>: 0,
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;mhz&#34;</span>: 3700.0171
</span></span><span class="line"><span class="cl"><span class="o">}</span>
</span></span><span class="line"><span class="cl"><span class="o">{</span>
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;cpu&#34;</span>: 1,
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;mhz&#34;</span>: 3700.2241
</span></span><span class="line"><span class="cl"><span class="o">}</span>
</span></span><span class="line"><span class="cl"><span class="o">{</span>
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;cpu&#34;</span>: 2,
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;mhz&#34;</span>: 3700.1121
</span></span><span class="line"><span class="cl"><span class="o">}</span>
</span></span><span class="line"><span class="cl"><span class="o">{</span>
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;cpu&#34;</span>: 3,
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;mhz&#34;</span>: 3884.2539
</span></span><span class="line"><span class="cl"><span class="o">}</span>
</span></span></code></pre></div><p>and later in power saver mode:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ lscpu --json --extended <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span>  <span class="p">|</span> jq <span class="s1">&#39;.cpus[] | {cpu: .cpu, mhz: .mhz}&#39;</span>
</span></span><span class="line"><span class="cl"><span class="o">{</span>
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;cpu&#34;</span>: 0,
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;mhz&#34;</span>: 1200.0580
</span></span><span class="line"><span class="cl"><span class="o">}</span>
</span></span><span class="line"><span class="cl"><span class="o">{</span>
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;cpu&#34;</span>: 1,
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;mhz&#34;</span>: 1200.0070
</span></span><span class="line"><span class="cl"><span class="o">}</span>
</span></span><span class="line"><span class="cl"><span class="o">{</span>
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;cpu&#34;</span>: 2,
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;mhz&#34;</span>: 1200.5450
</span></span><span class="line"><span class="cl"><span class="o">}</span>
</span></span><span class="line"><span class="cl"><span class="o">{</span>
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;cpu&#34;</span>: 3,
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;mhz&#34;</span>: 1200.0010
</span></span><span class="line"><span class="cl"><span class="o">}</span>
</span></span></code></pre></div><h2 id="lsusb--display-usb-devices-information" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#lsusb--display-usb-devices-information" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="lsusb--display-usb-devices-information"><code>lsusb</code> – Display USB Devices Information</a></h2><p>The <code>lsusb</code> command displays detailed information about the USB buses in the system and the devices connected to them. It is provided by the <code>usbutils</code> package and helps users and system administrators easily view the configuration and the devices attached to their USB interfaces:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ lsusb
</span></span></code></pre></div><p>This produces a list of all USB buses, devices connected to them, and brief information about each device, such as ID and manufacturer. This is particularly useful for a quick check of what devices are connected to the system and if you need the USB device ID for <a href="https://en.wikipedia.org/wiki/Udev" target="_blank" rel="noreferrer noopener">udev</a> rules or the like.</p>
<h3 id="usage-example-and-output" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#usage-example-and-output" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="usage-example-and-output">Usage example and output</a></h3><p>For those needing more detailed information about the USB devices, <code>lsusb</code> allows listing more detailed information:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ lsusb <span class="p">|</span> grep Fibocom
</span></span><span class="line"><span class="cl">Bus <span class="m">001</span> Device 013: ID 2cb7:0210 Fibocom L830-EB-00 LTE WWAN Modem
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">$ sudo lsusb -d 2cb7:0210 -v
</span></span><span class="line"><span class="cl">Bus <span class="m">001</span> Device 013: ID 2cb7:0210 Fibocom L830-EB-00 LTE WWAN Modem
</span></span><span class="line"><span class="cl">Device Descriptor:
</span></span><span class="line"><span class="cl">  bLength                <span class="m">18</span>
</span></span><span class="line"><span class="cl">  bDescriptorType         <span class="m">1</span>
</span></span><span class="line"><span class="cl">  bcdUSB               2.00
</span></span><span class="line"><span class="cl">  bDeviceClass          <span class="m">239</span> Miscellaneous Device
</span></span><span class="line"><span class="cl">  bDeviceSubClass         <span class="m">2</span> <span class="o">[</span>unknown<span class="o">]</span>
</span></span><span class="line"><span class="cl">  bDeviceProtocol         <span class="m">1</span> Interface Association
</span></span><span class="line"><span class="cl">  bMaxPacketSize0        <span class="m">64</span>
</span></span><span class="line"><span class="cl">  idVendor           0x2cb7 Fibocom
</span></span><span class="line"><span class="cl">  idProduct          0x0210 L830-EB-00 LTE WWAN Modem
</span></span><span class="line"><span class="cl">  bcdDevice            3.33
</span></span><span class="line"><span class="cl">  iManufacturer           <span class="m">1</span> FIBOCOM
</span></span><span class="line"><span class="cl">  iProduct                <span class="m">2</span> L830-EB-00
</span></span><span class="line"><span class="cl">  iSerial                 <span class="m">3</span> <span class="m">004999010640000</span>
</span></span><span class="line"><span class="cl">  bNumConfigurations      <span class="m">1</span>
</span></span><span class="line"><span class="cl">  Configuration Descriptor:
</span></span><span class="line"><span class="cl">    bLength                 <span class="m">9</span>
</span></span><span class="line"><span class="cl">    bDescriptorType         <span class="m">2</span>
</span></span><span class="line"><span class="cl">    wTotalLength       0x00a1
</span></span><span class="line"><span class="cl">    bNumInterfaces          <span class="m">4</span>
</span></span><span class="line"><span class="cl">    bConfigurationValue     <span class="m">1</span>
</span></span><span class="line"><span class="cl">    iConfiguration          <span class="m">0</span>
</span></span><span class="line"><span class="cl">    bmAttributes         0xe0
</span></span><span class="line"><span class="cl">      Self Powered
</span></span><span class="line"><span class="cl">      Remote Wakeup
</span></span><span class="line"><span class="cl">    MaxPower              100mA
</span></span><span class="line"><span class="cl"><span class="o">[</span> more output omitted <span class="k">for</span> readability <span class="o">]</span>
</span></span></code></pre></div><p>Using the <code>-v</code> and <code>-t</code> options will tell lsusb to dump the physical USB device hierarchy as a tree including IDs. The following shows a detailed tree of all USB devices (here using a <a href="https://www.thinkwiki.org/wiki/Category:T480s" target="_blank" rel="noreferrer noopener">ThinkPad T480S</a>), their types, speeds, and device classes. This is particularly useful for troubleshooting USB device issues:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ lsusb -t -v
</span></span><span class="line"><span class="cl">/:  Bus 001.Port 001: Dev 001, <span class="nv">Class</span><span class="o">=</span>root_hub, <span class="nv">Driver</span><span class="o">=</span>xhci_hcd/12p, 480M
</span></span><span class="line"><span class="cl">    ID 1d6b:0002 Linux Foundation 2.0 root hub
</span></span><span class="line"><span class="cl">    <span class="p">|</span>__ Port 001: Dev 002, If 0, <span class="nv">Class</span><span class="o">=</span>Human Interface Device, <span class="nv">Driver</span><span class="o">=</span>usbhid, 1.5M
</span></span><span class="line"><span class="cl">        ID 046d:c069 Logitech, Inc. M-U0007 <span class="o">[</span>Corded Mouse M500<span class="o">]</span>
</span></span><span class="line"><span class="cl">    <span class="p">|</span>__ Port 002: Dev 003, If 0, <span class="nv">Class</span><span class="o">=</span>Human Interface Device, <span class="nv">Driver</span><span class="o">=</span>usbhid, 1.5M
</span></span><span class="line"><span class="cl">        ID 046a:c098 CHERRY
</span></span><span class="line"><span class="cl">    <span class="p">|</span>__ Port 002: Dev 003, If 1, <span class="nv">Class</span><span class="o">=</span>Human Interface Device, <span class="nv">Driver</span><span class="o">=</span>usbhid, 1.5M
</span></span><span class="line"><span class="cl">        ID 046a:c098 CHERRY
</span></span><span class="line"><span class="cl">    <span class="p">|</span>__ Port 003: Dev 004, If 0, <span class="nv">Class</span><span class="o">=</span>Chip/SmartCard, <span class="nv">Driver</span><span class="o">=</span>usbfs, 12M
</span></span><span class="line"><span class="cl">        ID 058f:9540 Alcor Micro Corp. AU9540 Smartcard Reader
</span></span><span class="line"><span class="cl">    <span class="p">|</span>__ Port 005: Dev 005, If 0, <span class="nv">Class</span><span class="o">=</span>Video, <span class="nv">Driver</span><span class="o">=</span>uvcvideo, 480M
</span></span><span class="line"><span class="cl">        ID 5986:2123 Bison Electronics Inc.
</span></span><span class="line"><span class="cl">    <span class="p">|</span>__ Port 005: Dev 005, If 1, <span class="nv">Class</span><span class="o">=</span>Video, <span class="nv">Driver</span><span class="o">=</span>uvcvideo, 480M
</span></span><span class="line"><span class="cl">        ID 5986:2123 Bison Electronics Inc.
</span></span><span class="line"><span class="cl">    <span class="p">|</span>__ Port 006: Dev 013, If 0, <span class="nv">Class</span><span class="o">=</span>Communications, <span class="nv">Driver</span><span class="o">=</span>cdc_mbim, 480M
</span></span><span class="line"><span class="cl">        ID 2cb7:0210 Fibocom L830-EB-00 LTE WWAN Modem
</span></span><span class="line"><span class="cl">    <span class="p">|</span>__ Port 006: Dev 013, If 1, <span class="nv">Class</span><span class="o">=</span>CDC Data, <span class="nv">Driver</span><span class="o">=</span>cdc_mbim, 480M
</span></span><span class="line"><span class="cl">        ID 2cb7:0210 Fibocom L830-EB-00 LTE WWAN Modem
</span></span><span class="line"><span class="cl">    <span class="p">|</span>__ Port 006: Dev 013, If 2, <span class="nv">Class</span><span class="o">=</span>Communications, <span class="nv">Driver</span><span class="o">=</span>cdc_acm, 480M
</span></span><span class="line"><span class="cl">        ID 2cb7:0210 Fibocom L830-EB-00 LTE WWAN Modem
</span></span><span class="line"><span class="cl">    <span class="p">|</span>__ Port 006: Dev 013, If 3, <span class="nv">Class</span><span class="o">=</span>CDC Data, <span class="nv">Driver</span><span class="o">=</span>cdc_acm, 480M
</span></span><span class="line"><span class="cl">        ID 2cb7:0210 Fibocom L830-EB-00 LTE WWAN Modem
</span></span><span class="line"><span class="cl">    <span class="p">|</span>__ Port 007: Dev 007, If 0, <span class="nv">Class</span><span class="o">=</span>Wireless, <span class="nv">Driver</span><span class="o">=</span>btusb, 12M
</span></span><span class="line"><span class="cl">        ID 8087:0a2b Intel Corp. Bluetooth wireless interface
</span></span><span class="line"><span class="cl">    <span class="p">|</span>__ Port 007: Dev 007, If 1, <span class="nv">Class</span><span class="o">=</span>Wireless, <span class="nv">Driver</span><span class="o">=</span>btusb, 12M
</span></span><span class="line"><span class="cl">        ID 8087:0a2b Intel Corp. Bluetooth wireless interface
</span></span><span class="line"><span class="cl">    <span class="p">|</span>__ Port 008: Dev 008, If 0, <span class="nv">Class</span><span class="o">=</span>Video, <span class="nv">Driver</span><span class="o">=</span>uvcvideo, 480M
</span></span><span class="line"><span class="cl">        ID 5986:2115 Bison Electronics Inc.
</span></span><span class="line"><span class="cl">    <span class="p">|</span>__ Port 008: Dev 008, If 1, <span class="nv">Class</span><span class="o">=</span>Video, <span class="nv">Driver</span><span class="o">=</span>uvcvideo, 480M
</span></span><span class="line"><span class="cl">        ID 5986:2115 Bison Electronics Inc.
</span></span><span class="line"><span class="cl">    <span class="p">|</span>__ Port 009: Dev 009, If 0, <span class="nv">Class</span><span class="o">=</span>Vendor Specific Class, <span class="nv">Driver</span><span class="o">=[</span>none<span class="o">]</span>, 12M
</span></span><span class="line"><span class="cl">        ID 06cb:009a Synaptics, Inc. Metallica MIS Touch Fingerprint Reader
</span></span><span class="line"><span class="cl">/:  Bus 002.Port 001: Dev 001, <span class="nv">Class</span><span class="o">=</span>root_hub, <span class="nv">Driver</span><span class="o">=</span>xhci_hcd/6p, 5000M
</span></span><span class="line"><span class="cl">    ID 1d6b:0003 Linux Foundation 3.0 root hub
</span></span><span class="line"><span class="cl">    <span class="p">|</span>__ Port 003: Dev 002, If 0, <span class="nv">Class</span><span class="o">=</span>Mass Storage, <span class="nv">Driver</span><span class="o">=</span>usb-storage, 5000M
</span></span><span class="line"><span class="cl">        ID 0bda:0316 Realtek Semiconductor Corp. Card Reader
</span></span><span class="line"><span class="cl">/:  Bus 003.Port 001: Dev 001, <span class="nv">Class</span><span class="o">=</span>root_hub, <span class="nv">Driver</span><span class="o">=</span>xhci_hcd/2p, 480M
</span></span><span class="line"><span class="cl">    ID 1d6b:0002 Linux Foundation 2.0 root hub
</span></span><span class="line"><span class="cl">    <span class="p">|</span>__ Port 001: Dev 002, If 0, <span class="nv">Class</span><span class="o">=</span>Hub, <span class="nv">Driver</span><span class="o">=</span>hub/5p, 480M
</span></span><span class="line"><span class="cl">        ID 0451:8442 Texas Instruments, Inc.
</span></span><span class="line"><span class="cl">        <span class="p">|</span>__ Port 001: Dev 003, If 0, <span class="nv">Class</span><span class="o">=</span>Hub, <span class="nv">Driver</span><span class="o">=</span>hub/7p, 480M
</span></span><span class="line"><span class="cl">            ID 0424:2137 Microchip Technology, Inc. <span class="o">(</span>formerly SMSC<span class="o">)</span>
</span></span><span class="line"><span class="cl">        <span class="p">|</span>__ Port 003: Dev 005, If 0, <span class="nv">Class</span><span class="o">=</span>Hub, <span class="nv">Driver</span><span class="o">=</span>hub/3p, 480M
</span></span><span class="line"><span class="cl">            ID 0bda:5411 Realtek Semiconductor Corp. RTS5411 Hub
</span></span><span class="line"><span class="cl">            <span class="p">|</span>__ Port 001: Dev 006, If 0, <span class="nv">Class</span><span class="o">=</span>Vendor Specific Class, <span class="nv">Driver</span><span class="o">=</span>r8152, 480M
</span></span><span class="line"><span class="cl">                ID 0bda:8153 Realtek Semiconductor Corp. RTL8153 Gigabit Ethernet Adapter
</span></span><span class="line"><span class="cl">        <span class="p">|</span>__ Port 004: Dev 004, If 0, <span class="nv">Class</span><span class="o">=</span>Human Interface Device, <span class="nv">Driver</span><span class="o">=</span>usbhid, 480M
</span></span><span class="line"><span class="cl">            ID 0451:82ff Texas Instruments, Inc.
</span></span><span class="line"><span class="cl">/:  Bus 004.Port 001: Dev 001, <span class="nv">Class</span><span class="o">=</span>root_hub, <span class="nv">Driver</span><span class="o">=</span>xhci_hcd/2p, 10000M
</span></span><span class="line"><span class="cl">    ID 1d6b:0003 Linux Foundation 3.0 root hub
</span></span></code></pre></div><h2 id="conclusion" class="scroll-mt-20 md:scroll-mt-24 wrap-break-word group/heading "><a href="#conclusion" class="group-hover/heading:after:content-['#'] group-hover/heading:after:ml-1.5 group-hover/heading:after:text-content-400" id="conclusion">Conclusion</a></h2><p>Even though they are simple, both commands offer insights into the system’s configuration and status. Whether you’re troubleshooting, optimizing, or simply curious, these tools provide valuable data that can help you better understand and manage your Linux environment. See you next time when we will have a look at more useful listing and information command line tools and how to use them.</p>
]]></content><category scheme="taxonomy:tags" term="toolbox" label="toolbox"/><category scheme="taxonomy:tags" term="lscpu" label="lscpu"/><category scheme="taxonomy:tags" term="lsusb" label="lsusb"/></entry></feed>