One liner to show all the installed kernel modules
Posted by unixbhaskar@reddit | linuxadmin | View on Reddit | 7 comments
gawk '{print $1}' "/proc/modules" | xargs modinfo | gawk '/^(name|dep|desc|author|filename)/' | tac
coffeeoops@reddit
One liner to show the current time
gawk '/btime/{print $2}' /proc/stat \ | xargs -I{} awk -v b={} -v u="$(awk '{print int($1)}' /proc/uptime)" 'BEGIN{print b+u}' \ | xargs -I{} printf '%X\n' {} \ | xargs -I{} echo "ibase=16; {}" \ | bc \ | xargs -I{} date -d @{} +%H:%M:%S \ | tacTempus_Nemini@reddit
is there Barmin patch hidden somewhere in this line?
LameBMX@reddit
unless something has changed... this wont work. it will only show kernel modules loaded in memory.
say you run your command. it wont show ftdi_sio unless one is plugged into USB. the kernel modules is still available for use, aka installed (assuming you configured the driver as a module in your kernel) but wont be listed via your method because they arent loaded in ram, this, not in proc/mod.
same applies to an external added modules.
next up.. it also wont show any drivers built into the kernel. so again you would fully functioning hardware when the device is attached.. but your one liner would NOT expose that to a user.
you basically typed out lsmod in a very long and convoluted format.
maybe start with something that cat's /usr/src/linux/.config and grabs whatever with CONFIG_DRIVER_* and defines if they are =Y for built in or =M for module.
Suvalis@reddit
awk '{print $1}' /proc/modules | sort | while read -r mod; doecho "== $mod =="modinfo "$mod" | awk '/^(name|filename|description|author|depends):/'echodoneSuvalis@reddit
03263@reddit
lsmod
jtwyrrpirate@reddit
One worder.