Quel est la composition matériel de ma machine
La curiosité n’est pas un vilain défaut mais une qualité fondamentale.
Il y a une distribution linux créée depuis longtemps pour "soigner" votre ordinateur System Rescue, je dois retester si tout les programmes sont présents pour ce script.
Ce script peut vous servir pour connaître le contenu de votre ordinateur.
#!/usr/bin/env bash
#
# infos_machine.sh – Affiche un maximum d'informations sur la machine
# Usage : ./infos_machine.sh > rapport_machine.txt
set -o errexit
set -o nounset
set -o pipefail
echo "===== INFORMATIONS GENERALES ====="
date
echo "Hostname : $(hostname)"
echo "Utilisateur : $(whoami)"
echo "Uptime :"
uptime
echo
echo "===== OS / KERNEL ====="
if [ -r /etc/os-release ]; then
cat /etc/os-release
fi
echo
echo "Kernel : $(uname -srmo)"
echo
echo "===== CPU ====="
if command -v lscpu >/dev/null 2>&1; then
lscpu
else
grep -E 'model name|processor|cpu MHz|cache size' /proc/cpuinfo || true
fi
echo
echo "===== MEMOIRE (RAM) ====="
free -h
echo
if command -v dmidecode >/dev/null 2>&1; then
echo "Détails RAM (dmidecode) :"
sudo dmidecode -t memory || true
fi
echo
echo "===== CARTES / BUS PCI ====="
if command -v lspci >/dev/null 2>&1; then
lspci
fi
echo
echo "===== PERIPHERIQUES USB ====="
if command -v lsusb >/dev/null 2>&1; then
lsusb
fi
echo
echo "===== STOCKAGE / DISQUES ====="
echo "lsblk :"
lsblk -o NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT
echo
echo "df -h :"
df -hT
echo
if command -v lsscsi >/dev/null 2>&1; then
echo "lsscsi :"
lsscsi
echo
fi
if command -v smartctl >/dev/null 2>&1; then
echo "Disques (SMART – résumé) :"
for dev in /dev/sd? /dev/nvme?n1 2>/dev/null; do
echo "--- $dev ---"
sudo smartctl -H "$dev" || true
done
echo
fi
echo "===== BIOS / UEFI / CARTE MERE ====="
if command -v dmidecode >/dev/null 2>&1; then
echo "Résumé BIOS :"
sudo dmidecode -t bios || true
echo
echo "Carte mère / système :"
sudo dmidecode -t system || true
echo
fi
echo "===== RESEAU ====="
echo "Interfaces réseau :"
ip link show || true
echo
echo "Adresse(s) IP :"
ip addr show || true
echo
if command -v lshw >/dev/null 2>&1; then
echo "Détails carte(s) réseau (lshw) :"
sudo lshw -C network || true
fi
echo
echo "Table de routage :"
ip route show || true
echo
echo "===== AFFICHAGE / GPU ====="
if command -v lshw >/dev/null 2>&1; then
echo "GPU (lshw -C display) :"
sudo lshw -C display || true
fi
if command -v lspci >/dev/null 2>&1; then
echo
echo "GPU (lspci | grep -i vga) :"
lspci | grep -i 'vga|3d|display' || true
fi
echo
echo "===== RESUME COMPLET LSHW (peut être très long) ====="
if command -v lshw >/dev/null 2>&1; then
sudo lshw || true
else
echo "lshw non installé (installe-le pour un inventaire matériel complet : paquet lshw)."
fi
echo
echo "===== RESUME INXI (si disponible) ====="
if command -v inxi >/dev/null 2>&1; then
inxi -Fxxxrz || true
else
echo "inxi non installé (optionnel, pour un rapport synthétique : paquet inxi)."
fi
echo
echo "===== FIN DU RAPPORT ====="