uhm, there are several ways to get diagnostics
Code:
memtest
for memory checking.
Code:
smartmontools
for hard drives.
Code:
lshw
litsts all hardware (if it is implemented).
Code:
lspci -vv
will give you a looong list of hardware with detailed information on the hardware (if detected correctly).

the command for USB is (you guessed it)
Code:
lsusb -vv
for any errors encountered read the files under /var/log/ (text files) specifically
/var/log/syslog
/var/log/dmesg
/var/log/messages
/var/log/debug

Unix (Linux) is aimed at "one command one action, and do it well" many of the graphical programs use the command line commands, just allows for other output/input method.
if you can be ore specific with what you want to test it can likely be done in one go. if not otherwise very likely as a script executing commands above and some others then searching the output and logs for certain lines (error, failed would be good guesses) using cat, grep, sort... with pipes and redirections.