- Starting Up the Terminal
- Getting Started
- Building Pipelines
- Running Commands as Superuser
- Finding Help
- Moving around the Filesystem
- Manipulating Files and Folders
- System Information Commands
- Searching and Editing Text Files
- Dealing with Users and Groups
- Getting Help on the Command Line
- Searching for Man Files
- Using Wildcards
- Executing Multiple Commands
- Moving to More Advanced Uses of the Command Line
System Information Commands
System information commands include the following.
dfcommand displays filesystem disk space usage for all partitions. The command
df-his probably the most useful. It uses megabytes (
M) and gigabytes (
G) instead of blocks to report. (
freecommand displays the amount of free and used memory in the system. For example,
free -mgives the information using megabytes, which is probably most useful for current computers.
topcommand displays information on your Linux system, running processes, and system resources, including the CPU, RAM, swap usage, and total number of tasks being run. To exit
top, press Q.
uname -a: The
unamecommand with the
-aoption prints all system information, including machine name, kernel name, version, and a few other details. This command is most useful for checking which kernel you’re using.
lsb_release -a: The
lsb_releasecommand with the
-aoption prints version information for the Linux release you’re running. For example:
username@computer:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04
ifconfig: This reports on your system’s network interfaces.
iwconfigcommand shows you any wireless network adapters and the wireless-specific information from them, such as speed and network connected.
pscommand allows you to view all the processes running on the machine.
The following commands list the hardware on your computer, either of a specific type or with a specific method. They are most useful for debugging when a piece of hardware does not function correctly.
lspcicommand lists all PCI buses and devices connected to them. This commonly includes network cards and sound cards.
lsusbcommand lists all USB buses and any connected USB devices, such as printers and thumb drives.
lshalcommand lists all devices the hardware abstraction layer (HAL) knows about, which should be most hardware on your system.