Linux Commands Cheat Sheet - Linux Training Academy
Linux Commands Cheat Sheet - Linux Training Academy
Free Linux Command Line Cheat Sheet -> Email Download Now! ✕
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.
Enjoy!
1 – SYSTEM INFORMATION
# Display Linux system information
uname -a
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 1/19
20/12/2023, 15:22 Linux Commands Cheat Sheet | Linux Training Academy
2 – HARDWARE INFORMATION
# Display messages in kernel ring buffer
dmesg
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 2/19
20/12/2023, 15:22 Linux Commands Cheat Sheet | Linux Training Academy
Free Linux
# Display Command Line Cheat Sheet ->
CPU information Email ✕
cat /proc/cpuinfo
# Display free and used memory ( -h for human readable, -m for MB, -g for GB.)
free -h
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 3/19
20/12/2023, 15:22 Linux Commands Cheat Sheet | Linux Training Academy
Free Linux
# Display Command
and manage Line
the top Cheat Sheet ->
processes Email ✕
top
# Display the last 100 syslog messages (Use /var/log/syslog for Debian based systems.)
tail -100 /var/log/messages
# Display free and used memory ( -h for human readable, -m for MB, -g for GB.)
free -h
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 4/19
20/12/2023, 15:22 Linux Commands Cheat Sheet | Linux Training Academy
Free Linux
# Execute Command
"df -h", showing Line Cheatupdates
periodic Sheet -> Email ✕
watch df -h
# Display the last users who have logged onto the system.
last
# Create an account named john, with a comment of "John Smith" and create the user's home
useradd -c "John Smith" -m john
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 5/19
20/12/2023, 15:22 Linux Commands Cheat Sheet | Linux Training Academy
# Create a directory
mkdir directory
cp -r source_directory destination
Free Linux Command Line Cheat Sheet -> Email ✕
# Rename or move file1 to file2. If file2 is an existing directory, move file1 into direc
mv file1 file2
# Create an empty file or update the access and modification times of file.
touch file
# Display the last 10 lines of file and "follow" the file as it grows.
tail -f file
6 – PROCESS MANAGEMENT
# Display your currently running processes
ps
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 7/19
20/12/2023, 15:22 Linux Commands Cheat Sheet | Linux Training Academy
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 8/19
20/12/2023, 15:22 Linux Commands Cheat Sheet | Linux Training Academy
7 – FILE PERMISSIONS
Free Linux Command Line Cheat Sheet -> Email ✕
PERMISSION EXAMPLE
U G W
rwx rwx rwx chmod 777 filename
rwx rwx r-x chmod 775 filename
rwx r-x r-x chmod 755 filename
rw- rw- r-- chmod 664 filename
rw- r-- r-- chmod 644 filename
LEGEND
U = User
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 9/19
20/12/2023, 15:22 Linux Commands Cheat Sheet | Linux Training Academy
G = Group
Free ✕
W Linux Command Line Cheat Sheet ->
= World Email
r = Read
w = write
x = execute
- = no access
8 – NETWORKING
# Display all network interfaces and IP address
ip a
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 10/19
20/12/2023, 15:22 Linux Commands Cheat Sheet | Linux Training Academy
Free Linux ✕
# Display DNS IPCommand Line
address for Cheat Sheet ->
domain Email
host domain
# Download http://domain.com/file
wget http://domain.com/file
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 11/19
20/12/2023, 15:22 Linux Commands Cheat Sheet | Linux Training Academy
10 – INSTALLING PACKAGES
# Search for a package by keyword.
yum search keyword
# Install package.
yum install package
# Remove/uninstall package.
yum remove package
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 12/19
20/12/2023, 15:22 Linux Commands Cheat Sheet | Linux Training Academy
11 – SEARCH
Free Linux Command Line Cheat Sheet -> Email ✕
12 – SSH LOGINS
# Connect to host as your local username.
ssh host
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 13/19
20/12/2023, 15:22 Linux Commands Cheat Sheet | Linux Training Academy
13 – Free
FILELinux
TRANSFERS
Command Line Cheat Sheet -> Email ✕
# Copy all files and directories recursively from server to the current system's /tmp fol
scp -r server:/var/www /tmp
# Synchronize files/directories between the local and remote system with compression enab
rsync -avz /home server:/backups/
14 – DISK USAGE
# Show free and used space on mounted filesystems
df -h
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 14/19
20/12/2023, 15:22 Linux Commands Cheat Sheet | Linux Training Academy
# Display disk usage for all files and directories in human readable format
Free Linux Command Line Cheat Sheet -> Email ✕
du -ah
15 – DIRECTORY NAVIGATION
# To go up one level of the directory tree. (Change into the parent directory.)
cd ..
16 – SECURITY
# Change the current user's password.
passwd
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 15/19
20/12/2023, 15:22 Linux Commands Cheat Sheet | Linux Training Academy
# Display SELinux details such as the current SELinux mode, the configured mode, and the
sestatus
# Change the current SELinux mode to Permissive. (Does not survive a reboot.)
setenforce 0
# Change the current SELinux mode to Enforcing. (Does not survive a reboot.)
setenforce 1
# Set the SELinux mode to enforcing on boot by using this setting in the /etc/selinux/con
SELINUX=enforcing
# Set the SELinux mode to permissive on boot by using this setting in the /etc/selinux/co
SELINUX=permissive
# Set the SELinux mode to disabled on boot by using this setting in the /etc/selinux/conf
SELINUX=disabled
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 16/19
20/12/2023, 15:22 Linux Commands Cheat Sheet | Linux Training Academy
Free Linux
# Display Command
messages Line
in kernel Cheat
ring Sheet ->
buffer. Email ✕
dmesg
Related Articles:
Linux ip Command Networking Cheat Sheet
Vim Cheat Sheet
Managing Linux Users and Groups
23 Handy Bash Shell Aliases For Unix, Linux, and Mac OS X
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 17/19
20/12/2023, 15:22 Linux Commands Cheat Sheet | Linux Training Academy
AlmaLinux, CentOS, cheat sheet, Command Line, Linux, RedHat, Server, Shell Scripting, SSH, Ubuntu
Free Linux Command Line Cheat Sheet -> Email ✕
VirtualBox Troubleshooting Tips
Vim Cheat Sheet
Most Popular
Topics
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 18/19
20/12/2023, 15:22 Linux Commands Cheat Sheet | Linux Training Academy
AlmaLinux Arch
Free Linux Command LineCentOS
Linux Careers cheat
Cheat Sheet -> sheet
Email Cloud Command Line ✕
Debian Desktop DevOps Fedora File System FTP Installation Interviewing Jobs Linux
Linux Certifications Linux Mint MySQL Nginx OpenSuse Programming Python RedHat Rocky Linux SCP
Sed Server Shell Scripting Slackware SSH Text Editors Ubuntu Vagrant Video vim
Enter your email address below to download this Linux command line cheat sheet in an easy-to-read and ready-to-print format.
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/ 19/19