Terminal Cheat Sheet
1 – SYSTEM INFORMATION
Display kernel release information
Show which version of Red Hat installed
Show how long the system has been running + load
Show system host name
Display all local IP addresses of the host.
Show system reboot history
Show the current date and time
Show this month's calendar
Display who is online
Who you are logged in as
2 – HARDWARE INFORMATION
Display CPU information
Display memory information
Display free and used memory ( -h for human readable, -m for MB, -g for GB.)
Display PCI devices
Display USB devices
Display DMI/SMBIOS (hardware info) from the BIOS
Show info about disk sda
Perform a read speed test on disk sda
Test for unreadable blocks on disk sda
3 – PERFORMANCE MONITORING AND STATISTICS
Interactive process viewer (top alternative)
Display processor related statistics
Display virtual memory statistics
Display I/O statistics
Display the last 100 syslog messages (Use /var/log/syslog for Debian based systems.)
Capture and display all packets on interface eth0
Monitor all traffic on port 80 ( HTTP )
List all open files on the system
List files opened by user
Display free and used memory ( -h for human readable, -m for MB, -g for GB.)
Execute "df -h", showing periodic updates
4 – USER INFORMATION AND MANAGEMENT
Display the last users who have logged onto the system.
Show who is logged into the system.
Show who is logged in and what they are doing.
Create a group named "test".
Create an account named john, with a comment of "John Smith" and create the user's home directory.
Delete the john account.
Add the john account to the sales group
5 – FILE AND DIRECTORY COMMANDS
Display the present working directory
Create a directory
Remove (delete) file
Remove the directory and its contents recursively
Force removal of file without prompting for confirmation
Forcefully remove directory recursively
Copy file1 to file2
Copy source_directory recursively to destination. If destination exists, copy source_directory into destination, otherwise create destination with the contents of source_directory.
Rename or move file1 to file2. If file2 is an existing directory, move file1 into directory file2
Create symbolic link to linkname
Create an empty file or update the access and modification times of file.
View the contents of file
Browse through a text file
Display the first 10 lines of file
Display the last 10 lines of file
Display the last 10 lines of file and "follow" the file as it grows.
6 – PROCESS MANAGEMENT
Display all the currently running processes on the system.
Display process information for processname
Display and manage the top processes
Interactive process viewer (top alternative)
Kill process with process ID of pid
Kill all processes named processname
Start program in the background
Display stopped or background jobs
Brings the most recent background job to foreground
Brings job n to the foreground
7 – FILE PERMISSIONS
NOTE: Use 777 sparingly!
8 – NETWORKING
Display eth0 address and details
Query or control network driver and hardware settings
Send ICMP echo request to host
Display whois information for domain
Display DNS information for domain
Reverse lookup of IP_ADDRESS
Display DNS IP address for domain
Display the network address of the host name.
Display all local IP addresses of the host.
Download http://domain.com/file
Display listening tcp and udp ports and corresponding programs
9 – ARCHIVES (TAR FILES)
Extract the contents from archive.tar.
Create a gzip compressed tar file name archive.tar.gz.
Extract a gzip compressed tar file.
Create a tar file with bzip2 compression
Extract a bzip2 compressed tar file.
10 – INSTALLING PACKAGES
Install package.
Display description and summary information about package.
Install package from local file named package.rpm
Remove/uninstall package.
Install software from source code.
11 – SEARCH
Search recursively for pattern in directory
Find files and directories by name
Find files in /home/john that start with "prefix".
Find files larger than 100MB in /home
12 – SSH LOGINS
Connect to host as user
Connect to host using port
13 – FILE TRANSFERS
Copy *.html files from server to the local /tmp folder.
Copy all files and directories recursively from server to the current system's /tmp folder.
Synchronize /home to /backups/home
Synchronize files/directories between the local and remote system with compression enabled
14 – DISK USAGE
Show free and used inodes on mounted filesystems
Display disks partitions sizes and types
Display disk usage for all files and directories in human readable format
Display total disk usage off the current directory
15 – DIRECTORY NAVIGATION
Go to the $HOME directory
Change to the /etc directory
Command
Description
Last updated
