From 31a8dd20c3caa7d825873fc8635e72e2150973d5 Mon Sep 17 00:00:00 2001 From: x1phosura Date: Wed, 4 Aug 2021 09:29:14 -0700 Subject: [PATCH] Add specs.sh script --- .gitignore | 1 + bin/specs.sh | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 bin/specs.sh diff --git a/.gitignore b/.gitignore index ab1cd64..3881fb3 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,5 @@ etc bin/jdk-11* bin/ghidra* bin/android-studio* +bin/bookworm diff --git a/bin/specs.sh b/bin/specs.sh new file mode 100644 index 0000000..530b81b --- /dev/null +++ b/bin/specs.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +# This script (eventually) holds a bunch of commands that display basic +# hardware specification information (CPU, RAM, storage, etc...) so that I less +# frequently need to consult the internet or man pages. +# +# TODO: add more commands for more hardware peripherals +# +# x1phosura + + +_fetch_cpu_info() { + lscpu +} + +_fetch_ram_info() { + lsmem + free -h + # TODO: get info on what model RAM +} + +_fetch_blk_storage_info() { + sudo -v # validate sudo + + # get list of block devices, display information on each + blk_dev_list=$(lsblk | grep 'disk' | awk '{print $1}') + for blk_dev in $blk_dev_list ; do sudo hdparm -I /dev/$blk_dev ; done +} + +# TODO: add following: screen, NIC (wired/wireless), battery, camera, USB ports + + +# TODO: add command-line options to select which specs to display if desired + +_fetch_cpu_info +_fetch_ram_info +_fetch_blk_storage_info +