System and Hardware
OS info
uname: get system info-o: get OS info-s: get kernel name-r: get kernel release-v: get kernel version-n: get node hostname-m: get hardware architecture
lsb_release -a: get distro infohostname: get hostnamehostnamectl: get system infolsmod: list loadable kernel modules
Hardware Info
lshw stands for list hardware.
sudo lshw -shortsudo lshw -html > hardwareinfo.html
Disk Drive
lshw -c disk: info about storage controllerslshw -c volume: info about partitions and disk controllersfdisk -l: get partition table
Mount points
lsblk: list block devicesdf: “disk filesystem” - get filesystem disk usage-h: human-readable storage numbers
du <path>: “disk usage” - get disk usage of a folder-h: human-readable storage numbers-s: without subdirectories
Memory
lshw -c memory: info about memory hardwarefree: get RAM info (usage incl. swap)-h: human-readable storage numbers--si: Use SI prefixes (base 1000 instead of 1024)-t: include total
CPU Info
lshw -c cpu: info about cpulscpu: get cpu info
Other hardware components
lspci: list PCI deviceslsscsi: list SCSI deviceslsusb: list USB devicesbluetoothctl: list Bluetooth devicesboltctl list -a: list Thunderbolt devices
Process Information
top: get processes (interactive, like task manager)- Interactive shortcuts:
k <pid> <signal>: killr <pid> <priority>: reniceu <user>: only processes for userq: quiti: idleESC: manual refresh?: help
- Command arguments:
-b -n <N>: batch mode with iteration limit
- Interactive shortcuts:
htop: get processes (more modern)pgrep "<name>": find process PID by name-l: display names-a: display path
ps [-u <user>]: process status-e: every process-f: detailed-Z: also show SELinux context/labels- (typical:
-aux; can be grepped)
kill [...] <PID1> [PID2...]: send a signal to a process (default: TERM)-TERM(15): end gracefully (let process terminate itself)-KILL(9): kill forcefully (nuke process)-STOP(19): stop/pause process (same asCtrl-Z)-CONT(18): resume stopped process- => see
man 7 signalfor more
Network Info
ifconfig -aorio addr: list active network interfacesrouteorip route: display routing tablenetstat: display network connections, routing tables, interface statistics and more-p: include pid and process
ss: same but more TCP and state info
For more, see networking.