Files

8.5 KiB

General System Information

  • hostnamectl: Displays system hostname and identification data.
  • lsb_release -a: Provides LSB (Linux Standard Base) information about the distribution.
  • cat /etc/os-release: Shows information about the operating system, such as name, version, and ID.
  • uname -n: Displays the system's network node hostname.
  • uname -r: Shows the kernel release.

Kernel and System Version

  • cat /proc/version: Shows the Linux kernel version and related information.
  • uname -a: Displays kernel version, architecture, and other system information.
  • uname -r: Displays the kernel release version.
  • uname -v: Shows the kernel version and build date.
  • dmesg | grep -i linux: Displays boot-time messages, which often include kernel version information.

System Uptime and Load

  • uptime: Displays system uptime and load averages, useful for monitoring system performance.
  • w: Shows who is logged on and their activity, along with system uptime.
  • top -n 1 | head -n 10: Provides a quick snapshot of the system's uptime and load without continuous updating.

Hardware Information

  • lscpu: Shows detailed information about the CPU architecture.
  • lsblk: Lists information about block devices, such as hard drives and their partitions.
  • lspci: Lists PCI devices, providing details about internal hardware components.
  • lsusb: Lists USB devices connected to the system.
  • dmidecode: Outputs hardware information from the BIOS/UEFI, including system manufacturer, model, and serial number.
  • free -h: Displays memory usage in a human-readable format.
  • inxi -Fxz: Provides comprehensive system information, including hardware, network, and software details (requires installation).

Network Information

  • ip addr show: Shows IP addresses and network interfaces.
  • netstat -tuln: Displays listening sockets and associated programs, useful for network troubleshooting.
  • ss -tuln: Modern alternative to netstat, showing listening sockets and their statuses.
  • ifconfig: (Deprecated) Displays network interface information; ip addr is recommended for newer systems.
  • ip link show: Shows detailed information about network interfaces.

Disk Usage

  • df -h: Shows disk space usage in a human-readable format.
  • du -h: Estimates file space usage, providing details on disk usage of files and directories.
  • lsblk -f: Displays file system information for each block device.
  • df -i: Shows inode usage of file systems.

Process Information

  • ps aux: Lists all running processes with detailed information, including user, PID, CPU, and memory usage.
  • top: Provides real-time information about running processes and system resources, sorted by CPU usage.
  • htop: An interactive version of top with a more user-friendly interface for monitoring processes and system resources.
  • pstree: Displays running processes as a tree, showing parent-child relationships.
  • pgrep -l : Searches for processes matching a pattern.
  • pidstat: Provides detailed statistics on CPU, memory, and I/O usage per process.

Additional Useful Commands

  • dmesg | less: Views kernel ring buffer messages.
  • journalctl -xe: Views the systemd journal for debugging and log information.
  • vmstat: Provides detailed information on system processes, memory, paging, block I/O, traps, and CPU activity.
  • iostat: Provides CPU and I/O statistics, useful for identifying bottlenecks.

Comprehensive Linux System Information Commands

General System Information

  • hostnamectl: Displays system hostname and identification data
  • lsb_release -a: Provides LSB (Linux Standard Base) information about the distribution
  • cat /etc/os-release: Shows operating system information (name, version, ID)
  • uname -n: Displays the system's network node hostname

Kernel and System Version

  • cat /proc/version: Shows Linux kernel version and compilation details
  • uname -a: Displays comprehensive system information (kernel, architecture, hostname)
  • uname -r: Shows kernel release version
  • uname -v: Displays kernel version with build timestamp
  • dmesg | grep -i linux: Shows boot messages containing kernel information

System Uptime and Performance

  • uptime: Shows system uptime and load averages (1, 5, 15 minutes)
  • w: Displays logged-in users and their activity plus system uptime
  • cat /proc/loadavg: Raw load average data
  • nproc: Shows number of available processing units

Hardware Information

  • lscpu: Detailed CPU architecture and feature information
  • lsblk: Lists block devices (drives, partitions) in tree format
  • lsblk -f: Includes filesystem information for block devices
  • lspci: Lists PCI devices (graphics cards, network adapters, etc.)
  • lspci -v: Verbose PCI device information
  • lsusb: Lists connected USB devices
  • lsusb -v: Verbose USB device details
  • dmidecode: Hardware information from BIOS/UEFI (requires root)
  • dmidecode -t system: System manufacturer and model info
  • free -h: Memory usage in human-readable format
  • cat /proc/meminfo: Detailed memory statistics
  • lshw: Comprehensive hardware information (may require installation)
  • inxi -Fxz: System overview including hardware and software (requires installation)

Storage and Filesystem Information

  • df -h: Disk space usage in human-readable format
  • df -i: Inode usage statistics
  • du -h /path: Directory space usage
  • du -sh /path: Summary of directory size
  • lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT: Detailed block device info
  • findmnt: Shows mounted filesystems in tree format
  • blkid: Lists block device UUIDs and filesystem types

Network Information

  • ip addr show: Current IP addresses and network interfaces
  • ip link show: Network interface details and status
  • ip route show: Routing table information
  • ss -tuln: Listening sockets (TCP/UDP) - modern netstat replacement
  • ss -tulpn: Includes process information for listening sockets
  • netstat -tuln: Traditional socket listing (often deprecated)
  • netstat -rn: Routing table (traditional command)
  • iwconfig: Wireless interface configuration (if available)

Process and Service Information

  • ps aux: All running processes with resource usage
  • ps -ef: Alternative process listing format
  • top: Real-time process monitor (press 'q' to quit)
  • htop: Enhanced interactive process viewer (requires installation)
  • pstree: Process tree showing parent-child relationships
  • pgrep -l pattern: Find processes by name pattern
  • pidof process_name: Get PID of specific process
  • systemctl list-units --type=service: Active systemd services
  • systemctl status service_name: Specific service status

System Monitoring and Performance

  • vmstat 1 5: Virtual memory statistics (1-second intervals, 5 samples)
  • iostat 1 5: I/O statistics for devices
  • iotop: Real-time I/O usage by process (requires installation)
  • pidstat 1 5: Per-process statistics
  • sar: System activity reporter (part of sysstat package)
  • mpstat: Multi-processor usage statistics

Logs and System Messages

  • dmesg | less: Kernel ring buffer messages
  • dmesg -T: Kernel messages with human-readable timestamps
  • journalctl -xe: Recent systemd journal entries with explanations
  • journalctl -f: Follow journal in real-time
  • journalctl -u service_name: Logs for specific service
  • tail -f /var/log/syslog: Follow system log (on systems using syslog)

Environment and Configuration

  • env: Display environment variables
  • printenv: Alternative to display environment variables
  • cat /proc/cmdline: Kernel boot parameters
  • lsmod: List loaded kernel modules
  • systemctl list-unit-files: All systemd unit files and their states
  • crontab -l: Current user's scheduled tasks
  • sudo crontab -l: Root user's scheduled tasks

Quick System Overview Commands

# One-liner system summary
uname -a && uptime && free -h && df -h

# Hardware overview
lscpu && free -h && lsblk

# Network quick check
ip addr show && ss -tuln

# Process overview
ps aux --sort=-%cpu | head -10

Tips for Usage

  • Use --help or man command_name for detailed options
  • Many commands support -h for human-readable output
  • Root privileges may be required for some hardware information commands
  • Consider installing additional tools like htop, iotop, inxi for enhanced functionality
  • Combine commands with pipes for filtered output: ps aux | grep process_name