Skip to content

Instantly share code, notes, and snippets.

@r15ch13
r15ch13 / iommu.sh
Last active November 11, 2026 05:41
List IOMMU Groups and the connected USB Devices
#!/usr/bin/env bash
# License: https://r15ch13.mit-license.org
shopt -s nullglob
lastgroup=""
for g in `find /sys/kernel/iommu_groups/* -maxdepth 0 -type d | sort -V`; do
for d in $g/devices/*; do
if [ "${g##*/}" != "$lastgroup" ]; then
echo -en "Group ${g##*/}:\t"
else