+-----------------------------------------------------------------------------+ | | | Linux - CLI - Command line system information query commands | | | +-----------------------------------------------------------------------------+ | lsn; 20020409; created documentation | | lsn; 20020725; added commands | | lsn; 20030919; revised structure and added more commands | +-----------------------------------------------------------------------------+ Note: Some of the following commands may or may not work on your particular distribution depending on whether or not the package containing the command has been installed. Also, some of the commands/files may only be accessed as root. +--------------------------------- VERSION -----------------------------------+ command: uname (print system version information) - usage: uname -a file: /etc/issue (contains Linux release number and Kernel version) - usage: cat /etc/issue file: /etc/issue.net (contains Linux release number and Kernel version) - usage: cat /etc/issue.net --> The difference between issue & issue.net is: issue contains the information that is reported to the local shell, whereas issue.net contains information that is reported to a remote shell. +--------------------------------- MEMORY ------------------------------------+ command: free (display amount of free and used memory in the system) - usage: free -m file: /proc/meminfo (a slightly different listing of memory utilization) - usage: cat /proc/meminfo +--------------------------------- CPU ---------------------------------------+ command: top (display top CPU processes) - usage: top +--------------------------------- PROCESSES ---------------------------------+ command: ps (report process status) - usage: ps -ef |more command: pstree (display a tree of processes) - usage: pstree -hacup |more +--------------------------------- SYSTEM MESSAGES ---------------------------+ command: dmesg (print or control the kernel ring buffer) - usage: dmesg |more file: /var/log/messages (where system messages & error messages are stored) - usage: more /var/log/messages +--------------------------------- HARDWARE DEVICES --------------------------+ command: lsdev (display information about installed hardware) - options: none +--------------------------------- CPU ---------------------------------------+ file: /proc/cpuinfo (contains info about your processor) - usage: cat /proc/cpuinfo +--------------------------------- PCI ---------------------------------------+ command: lspci (list all PCI devices) - usage: lspci or lspci -v file: /proc/pci (contains information about pci devices in your system) - usage: cat /proc/pci |more +--------------------------------- PROC --------------------------------------+ command: procinfo (display system status gathered from /proc) - usage: procinfo -a |more +--------------------------------- SOCKETS -----------------------------------+ command: socklist (display list of open sockets) - options: none +--------------------------------- NETWORK STATUS ----------------------------+ command: netstat (Print network connections, routing tables, interface stats, masquerade connections, and multicast memberships) - options: many - usage: netstat -an |more +--------------------------------- FILES -------------------------------------+ command: lsof (list open files) - options: many - usage: /usr/sbin/lsof -i tcp: +--------------------------------- LIBRARY FILES -----------------------------+ command: ldd (print shared library dependencies) - usage: locate lsof file /usr/sbin/lsof ldd -d /usr/sbin/lsof +--------------------------------- FILE TYPES --------------------------------+ command: file (determine file type) - usage: file example: file ldd - output: /usr/bin/ldd: Bourne shell script text +--------------------------------- WHICH FILES -------------------------------+ command: which (shows the full path of shell commands) - usage: which example: which ldd - output: /usr/bin/ldd +--------------------------------- WHEREIS -----------------------------------+ command: whereis (locate the binary, source, & man page files) - usage: whereis example: whereis ldd - output: ldd: /usr/bin/ldd /usr/man/man1/ldd.1 +--------------------------------- WHO ---------------------------------------+ command: who (show who is logged on) - usage: who +--------------------------------- DF ----------------------------------------+ command: df (report filesystem disk space usage) - options: many - usage: df -h +--------------------------------- UPTIME ------------------------------------+ command: uptime (tell how long the system has been running) +--------------------------------- LOCATE ------------------------------------+ command: locate (find files on your system) - usage: locate |more +--------------------------------- X -----------------------------------------+ command: X -version (tell me what version of X I am running) +--------------------------------------end------------------------------------+