Linux Commands Cheat Sheet - Linux Training Academy
Linux Commands Cheat Sheet - Linux Training Academy
About
Products
Books
Linux for Beginners
Resources
Video Training Courses
The interesting thing is that most people only need to use a very small subset of those
commands. Below you’ll find a Linux “cheat sheet” that breaks down some of the most
commonly used commands by category.
To get your own PDF and printable copy, scroll to the bottom of the page.
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 1/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
Enjoy!
Contents [hide]
1 – SYSTEM INFORMATION
2 – HARDWARE INFORMATION
3 – PERFORMANCE MONITORING AND STATISTICS
4 – USER INFORMATION AND MANAGEMENT
5 – FILE AND DIRECTORY COMMANDS
6 – PROCESS MANAGEMENT
7 – FILE PERMISSIONS
8 – NETWORKING
9 – ARCHIVES (TAR FILES)
10 – INSTALLING PACKAGES
11 – SEARCH
12 – SSH LOGINS
13 – FILE TRANSFERS
14 – DISK USAGE
15 – DIRECTORY NAVIGATION
1 – SYSTEM INFORMATION
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 2/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
uname -r
cat /etc/redhat-release
uptime
hostname
hostname -I
last reboot
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 3/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
cal
whoami
2 – HARDWARE INFORMATION
# Display messages in kernel ring buffer
dmesg
cat /proc/cpuinfo
cat /proc/meminfo
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 4/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
free -h
lspci -tv
lsusb -tv
dmidecode
hdparm -i /dev/sda
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 5/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
top
htop
mpstat 1
vmstat 1
iostat 1
# Display the last 100 syslog messages (Use /var/log/syslog for Debian
based systems.)
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 6/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
tcpdump -i eth0
lsof
lsof -u user
# Display free and used memory ( -h for human readable, -m for MB, -g for
GB.)
free -h
watch df -h
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 7/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
# Display the last users who have logged onto the system.
last
who
groupadd test
# Create an account named john, with a comment of "John Smith" and create
the user's home directory.
userdel john
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 8/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
ls -al
pwd
# Create a directory
mkdir directory
rm file
rm -r directory
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 9/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
rm -f file
rm -rf directory
cp file1 file2
cp -r source_directory destination
mv file1 file2
ln -s /path/to/file linkname
# Create an empty file or update the access and modification times of file.
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 10/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
touch file
cat file
less file
head file
tail file
tail -f file
6 – PROCESS MANAGEMENT
# Display your currently running processes
ps
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 11/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
top
htop
kill pid
killall processname
program &
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 12/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
fg
fg n
7 – FILE PERMISSIONS
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 13/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
U G W
LEGEND
U = User
G = Group
W = World
r = Read
w = write
x = execute
- = no access
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 14/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
8 – Linux
Free NETWORKING
Command Line Cheat Sheet ->
Email
Download Now! ✕
ip a
ethtool eth0
ping host
whois domain
dig domain
dig -x IP_ADDRESS
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 15/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
host domain
hostname -i
hostname -I
# Download http://domain.com/file
wget http://domain.com/file
netstat -nutlp
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 16/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
tar xf archive.tar
10 – INSTALLING PACKAGES
# Search for a package by keyword.
# Install package.
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 17/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
rpm -i package.rpm
# Remove/uninstall package.
cd sourcecode
./configure
make
make install
11 – SEARCH
# Search for pattern in file
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 18/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
locate name
12 – SSH LOGINS
# Connect to host as your local username.
ssh host
ssh user@host
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 19/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
13 Linux
Free – FILE TRANSFERS
Command Line Cheat Sheet ->
Email
Download Now! ✕
# Copy all files and directories recursively from server to the current
system's /tmp folder.
# Synchronize /home to /backups/home
14 – DISK USAGE
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 20/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
df -i
fdisk -l
# Display disk usage for all files and directories in human readable format
du -ah
du -sh
15 – DIRECTORY NAVIGATION
# To go up one level of the directory tree. (Change into the parent
directory.)
cd ..
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 21/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
cd
cd /etc
Related Posts:
Linux ip Command Networking Cheat Sheet
Vim Cheat Sheet
Managing Linux Users and Groups
How to Find Any File or Command on a Linux System
Filed Under: blog — Tagged With: CentOS, cheat sheet, Command Line, Linux, RedHat, Server, Shell Scripting,
SSH, Ubuntu
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 22/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
Most Popular
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 23/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
Topics
Arch Linux
Careers
CentOS
cheat
sheet
Cloud
Command
Line
Debian
Desktop
DevOps
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 24/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
Fedora
File System
FTP
Gentoo ✕
Free Linux Command Line Cheat Sheet ->
Email Download Now!
Installation
Interviewing
Jobs
Linux
Linux Certifications
Linux Mint
Mageia
MySQL
Nginx
OpenSuse
Programming
Python
RedHat
SCP
Sed
Server
Shell Scripting
Slackware
SSH
Text Editors
Ubuntu
Vagrant
Video
vim
VirtualBox
Web
Hosting
Windows
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 25/26
8/6/2021 Linux Commands Cheat Sheet | Linux Training Academy
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 26/26