Skip to content

Instantly share code, notes, and snippets.

@anchaides
anchaides / iommu.sh
Created June 16, 2024 22:45 — forked from r15ch13/iommu.sh
List IOMMU Groups and the connected USB Devices
#!/usr/bin/env bash
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
echo -en "\t\t"