Skip to content

Instantly share code, notes, and snippets.

@shdbwa
Last active April 25, 2020 10:38
Show Gist options
  • Save shdbwa/34c393e5e08f019f1c345ce46dd67d73 to your computer and use it in GitHub Desktop.
Save shdbwa/34c393e5e08f019f1c345ce46dd67d73 to your computer and use it in GitHub Desktop.
Get module configuration
#!/bin/sh
# Searchable list showing kernel modules with (lsmod), piped (|) via (percol). Pipe (|) the output with (awk), filte for the first field (print $1). Grab the result (xargs -0) as argument for (echo) to write it to disk (>) as (/tmp/showmoduleconfig)
lsmod | percol | awk '{print $1}'|xargs -0 echo > /tmp/showmoduleconfig ;
# Display (cat) previousely selected module config (-m) in verbose mode (-v) with (systool). Remove (rm) the temporary file created (/tmp/showmoduleconfig). Colorize (pygmentize) output like a (linux-config) file with lexer (-l linux-config)
systool -v -m (cat /tmp/showmoduleconfig) & rm /tmp/showmoduleconfig | pygmentize -l linux-config ;
#One line
lsmod|percol|awk '{print $1}'|xargs -0 echo > /tmp/percol;systool -v -m (cat /tmp/percol)|pygmentize -l linux-config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment