Linux Console Information
- @for Linuxers
- @author Kai Ruhl
- @since 2010-09
Introduction
Ok, so you are on a Linux system. On the console.
And you want to know whats going on. This tutorial is for you!
We will cover the following topics:
- Hardware
- Users and Load
- Network
Without further ado, here we go...
Hardware
Be root (whoami and sudo su) and type the following:
- uname -r: What kernel you are running.
- lspci: What hardware is connected to your PCI bus.
- lsusb: What hardware is connected to your USB bus.
- cat /proc/cpuinfo: Number and properties of your CPUs.
- cat /proc/meminfo: What happens to your RAM.
- hdparm -I /dev/sda: The state of your hard drive.
- df -h: Mounted partitions, and their sizes.
- du -sh <directory>: The size of a directory and all of its files.
Users and Load
Now you got the system running. Who is running on it, anyway?
Try the following (again as root):
- ps ax: All running processes, in a nutshell.
- top (or better, htop when available): All running processes, including the owning users. Also good with the -u <username> option.
- vmstat: One-line summary of system resources. Also good as vmstat 1 (gives update every second).
- w: What users are online, and what are they doing? Also as w <username>.
- uptime: How long has the system been running since last reboot?
- iostat: Activity on your harddisks/partitions right now.
See also this this useful
Cyberciti article
for additional command line options.
Network
We got the machine, now we get to the wires or radio waves attached to it.
- netstat -l: All open server ports, including stuff running over local ports.
- ss: Established connections to other computers (and to localhost).
- iptraf: The htop of network packages.
- tcpdump -i eth0 'tcp port 22': Sniff e.g. SSH traffic on a network card.
- nmap <hostname>: What ports your other machines have open.
Conclusion
So, this was our little tour de force! A little more:
I hope you are now a little bit smarter about your Linux system.
Any questions or comments, contact me via mail to kain at the above domain.
Thanks for leaving a part of your attention span here, and have a good day!
EOF (Mar:2021)