Skip to content

Instantly share code, notes, and snippets.

@albertosaurus
Created March 11, 2018 00:58
Show Gist options
  • Save albertosaurus/9f44ee60734b79f10a8fea03e1d8cedd to your computer and use it in GitHub Desktop.
Save albertosaurus/9f44ee60734b79f10a8fea03e1d8cedd to your computer and use it in GitHub Desktop.
List off-tree linux kernel modules
#!/bin/bash
locate --null "*lib/modules/$(uname -r)*" | xargs -r0 sh -c 'for i do [ -d "$i" ] && printf "%s\n" "$i"; done' sh {} + | grep -v "^/lib/modules/$(uname -r)/kernel\|^/lib/modules/$(uname -r)$\|^/lib/modules/$(uname -r)/build$\|^/lib/modules/$(uname -r)/initrd$" | xargs ls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment