Let’s be honest — the Linux terminal can feel intimidating at first. It’s that mysterious black window filled with commands that look like something out of a hacker movie. But here’s the truth: you don’t need to be a genius to master it — you just need the right guide. That’s exactly what this Linux commands cheat sheet is designed to be.
Think of it as your quick-reference companion for getting things done faster in Linux. Whether you’re a beginner trying to navigate files and directories or an experienced user brushing up on syntax you haven’t used in a while, this cheat sheet will save you time, frustration, and endless searches for “that one command you forgot.”
Inside, you’ll find the most commonly used Linux commands — from essential system and file operations to networking, permissions, and even a few penetration testing favorites — all organized with clear explanations and easy-to-copy examples.
Let’s turn that black window from something you avoid into your most powerful productivity tool.
System Commands: Your Computer’s Vital Signs
Think of system commands like your car’s dashboard. They don’t drive the car, but they tell you everything about it: how fast you’re going, how much fuel is left, and if any warning lights are on. Similarly, system commands give you a quick health check and let you perform basic controls on your machine.
‘Linux is fun to operate, but it is not easy to operate.’ Daniel j. Barrett
On a conventional system, you have GUI (graphical user interface) to click on, making life easy. But it can’t offer flexibility like Linux. For someone into a bit of coding or computer science, Linux is a great choice to learn. This article shared some of the most essential and underdog Linux commands, serving as Linux commands cheat sheets for your daily needs.

We will also be dividing sections, making it easier to browse the article when you’re looking for specific commands.
Linux distro is fascinating, among other things. As most people use GUI-based operating systems, the turnover can get tricky. However, regular practice can get you to speed at no time. Operating Linux with commands is no magic, but you’ll be surprised by the power in those fingers once you get to command tasks with simple controls.
The Linux Commands Cheat Sheet contains:
● Basic & Advanced Linux Commands Cheat Sheet
● Tips and Tricks
● Quick References
Basic & Advanced Linux Commands Cheat Sheet
List and View Files Quickly
| ls | To list view files in the present directory |
| ls-R | To list view files in sub-directories |
| ls-a | List view hidden files in the folder |
| ls-al | View detailed file information such as size, location, permission in a list |
Directory Handling
| cd or cd ~ | Return to Home directory |
| cd .. | To move up a level |
| cd | For easy direction to another directory or folder |
| cd / | This one is used to view the root directory |
File Modification
| cat > filename | For creating new a new file |
| cat filename | View contents of a file |
| mv filename | Rename the filename |
| sudo | To run programs with superuser, or root, or administrator |
| rm filename | Delete file |
Hardware Information
| dmesg | Enable message on boot |
| cat /proc/ cpuinfo | As the name suggests, the command is used to view CPU information |
| free -h | View memory information |
| lshw | View hardware configuration information in a list |
| lsblk | Lists blocked devices |
| spci | Available controller information’s alongside host bridge |
| lspci -tv | To show available PCI devices in a tree-like diagram |
| lsusb -tv | To view available USB devices in a tree-like diagram |
| dmidecode | BIOS information on hardware |
| hdparm -i /dev/[disk] | Show disk data |
| hdparm -tT /dev/[disk] | Perform disk checkup |
| badblocks -s /dev/[disk] | Review unreadable disk space |
Search Query
| grep [pattern] [X] | Find file pattern where ‘X’ is the file name |
| grep -r [pattern] [X] | Find a specific location where ‘X’ is the directory |
| locate [X] | Find all files in the directory where ‘X’ is the file name |
| find [/folder/location] -name [X] | Find a list of names starting with the letter ‘X’ |
| find [/folder/location] -size [X] | Find specific files in folders with a size greater than ‘X’ |
File Compression
| tar cf [X.tar] [X] | Create an archive where ‘X’ is the filename |
| tar xf [X.tar] | Extract or unzip a file where ‘X’ is the zip |
| tar czf [X.tar.gz] | To convert zip to tar where ‘X’ is the file |
| gzip [X] | For compressing a to .gz extension where ‘X’ is the filename |
Process Handling
| ps | Shows active process information |
| pstree | Show process in tree-view |
| pmap | Memory usage information in a process |
| kill [process_id] | To kill a specific process, similar to ending from Windows taskbar |
| bg | Listing and re-running process |
| lsof | Show files in the process |
| fg | With this command, we can rerun the most recently killed process, similar to ‘undo’ |
| pkill [X] | Kill a process where ‘X’ is the name |
| killall [X] | Kill all process named ‘X’ |
Package Installation
| yum search [keyword] | Find packages easily by keyword |
| yum info [X] | Show package info where ‘X’ is the package name |
| yum install [X. rpm] | Install the package named ‘X’ |
| dnf install [X. rpm] | Installing a package with the help of DNF |
| rpm -i [X. rpm] | Installing a package from the local file (-I to include) |
| rpm -e [X. rpm] | Remove rpm package (‘-e’ to exclude) |
File Permission
| chmod 777 [X] | Giving file permission to all users where ‘X’ is the filename |
| chmod 766 [X] | Giving file permission to all groups of users where ‘X’ is the filename |
| x | Executing file permission |
| w | Adding new permission to write a file |
| r | Permission to read the file |
| chown [user] [X] | Transfer file ownership where ‘X’ is the filename |
| chown [user]: [group] [X] | Transfer group rule over a file where ‘X’ is the filename |
SSH Login
| ssh user@host | For connecting to host |
| sh host | Secure connection with a host |
| ssh -p [X] user@host | Connect to a specific port where ‘X’ is port number |
| telnet host | Connect to host via Telnet |
Networking Commands
| SSH hostname | Login to remote SSH connection |
| Ping hostname=”” | To check network statuses such as ping and response |
| dir | Display files in the current directory remotely |
| cd “dirname” | Changing directory remotely |
| get X | Downloading a file, it can be a link too |
| put X | Upload file to a remote computer |
| quit | Logout |
VI Editing
| i | Insert the cursor |
| a | Start writing after the cursor |
| A | To start writing at the end of line |
| ESC | Terminate insert mode |
| u | Undo the last change |
| U | Undo the full line |
| o | For opening a new line |
| dd | Delete the line |
| 5dd | Delete five lines, the number corresponds to the lines to delete |
Module Management
| username -a | To know about the Kernel version and architecture |
| lsmod | Find out the running modules |
| modinfo X | Get information about the ‘X’ module |
| modprobe –remove X | Remove specific module where ‘X’ is the module name |
| modprobe X | Load ‘X’ module into the kernel |
Tips and Tricks
The Linux Commands Cheat Sheet is not only your gateway for cool commands but alongside tips and tricks for taking the skill further.
Configuring Linux with new hardware and kernel can become tricky as multiple devices need their configuration. We need to enable modules to load the kernel into a fixed memory size. The first step is to do modules and install them.
| make modules | To create new modules |
| make moudles_install | To install the module. |
Though most professionals use Linux as their primary OS, many use a virtual environment to live boot Linux images. Both have their advantages and drawbacks. One of the most reported finds is the wrong memory size. Suppose your computer has 16 GB of RAM, but it will only detect 8 Gb. To solve this, we need to set memory parameters.
| LILO boot: linux mem=16GB | Parameterizing memory for boot |
The Commands
uname
Shows your system’s basic name. Comes with different flags, few of which we can see below.
uptime
Tells you how long your computer has been running without a restart.
who
It shows a simple list of who is currently logged into the computer, lists usernames, their terminal sessions, and login times.
w
Like who, but also shows what command each user is running right now.
whoami
A simple command that answers “What is my current username?”. Lets say a user “John” runs the command whoami then it will print your username like “john”. A user “root” will print roor
groupadd
This command is used to create a group in linux. For example,
useradd
Just like groupadd, useradd is used to add a user in linux. For example, in below command, -m is used to create the user’s directory and -g is provided to add the user is a group
passwd
The next command in handy is passwd. After you create the user, you set the password for it.
su
This is used to switch users. Lets you become another user, often the “root” (admin) user. Let us use the newly created user to switch to root.
The error is because the john is not added in the sudoers file. Which leads us to the next command.
usermod
This command is used to add a user in sudoers
Now if we switch from john to root, we will be successful
date
This command shows the current date and time according to your system.
halt
halt command stops the system immediately. (Use with caution).
shutdown
This schedules a time to safely turn off the computer or restart it.
Input/Output Redirection
These commands and symbols are like plumbing for your terminal. They control where information comes from and where it goes, which is incredibly helpful for saving output to files or connecting commands together.
The Commands
echo TEXT
Prints a line of text or the contents of a variable to the screen.
echo -e TEXT
Interprets special escape characters inside the text, like \n for a new line or \t for a tab.
echo -n TEXT
Prints text without adding a newline at the end. The next prompt will appear right after your text.
cmd1 | cmd2
The pipe character. It takes the output from the command on the left (cmd1) and uses it as the input for the command on the right (cmd2). For example, the output can be something like
cmd > file
Redirects the command’s output into a file, completely replacing the file’s previous contents.
cmd > /dev/null
Suppresses and discards the normal output of a command. Useful for running commands where you don’t care to see the results.
cmd >> file
Appends the command’s output to the end of a file, preserving whatever was already in there.
cmd < file
Reads input for a command from a file instead of from the keyboard.
cmd << delim
Reads input directly from the terminal until it sees your chosen delimiter. Perfect for typing multi-line input on the spot.
File Management
These commands are your basic tools for working with files and folders – creating, moving, viewing, and organizing everything on your system.
ls Lists the files and folders in your current directory. Its true power comes from combining flags.
Wildcards: * and ?
The * symbol matches any number of characters, while ? matches exactly one character.
cd
Changes your current working directory. Use .. to go up one level or just cd to go home.
cmp & diff
cmp checks if two files are identical, while diff shows you the exact differences between them.
pwd
Shows the full path of your current working directory—your “you are here” marker.
mkdir
Creates a new directory. Use -p to create nested directories in one command.
mv
Moves files or directories to a new location, or renames them.
cp
Copies files or directories. The -r flag is essential for copying folders.
Rm
Deletes files and directories permanently. Use with extreme caution, especially with -r and -f.
rmdir
Removes an empty directory – a safer alternative to rm -r for empty folders.
du
Shows disk usage of files and directories. -h makes sizes human-readable, -s shows totals.
df
Displays free disk space on your mounted filesystems.
open
Opens a file with its default application (primarily on macOS systems).
touch
Creates a new empty file or updates the timestamp of an existing file.
cat
Displays the entire contents of a file. Use -b to show line numbers.
wc
Counts lines, words, and characters in a file.
head & tail
Show the beginning or end of a file. Perfect for peeking at large files.
less
Opens a file in a viewer that lets you scroll and search through content easily.
ln -s
Creates a symbolic link – a shortcut that points to another file or directory.
Search and Filter
These commands help you find specific information in files and filter results to show only what you need.
The Commands
grep
Searches for text patterns within files. It’s incredibly versatile with different flags for different needs.
find
Locates files and directories based on various criteria like name, size, or type.
locate
Finds files quickly using a pre-built database. Much faster than find but may not show recently created files.
sort
Arranges lines of text in alphabetical or numerical order. Perfect for organizing output.
File Transfer
These commands let you securely connect to other computers and transfer files between them.
ssh
Connects to a remote server securely. Once connected, you can run commands as if you were sitting at that machine.
scp
Copies files between computers over an encrypted SSH connection. Think of it as a secure version of cp.
File Permissions
These commands control who can read, write, or execute your files and folders.
chmod
Changes file permissions using either letters (u,g,o) or numbers (octal mode).
chown
Changes the owner of a file or directory. Often used with -R to change ownership recursively.
chgrp
Changes the group ownership of a file or directory.
Common Permission Scenarios
Make script executable for everyone
Private file – only you can read/write
Shared folder – you have full access, group can read/enter
Web files – readable by everyone, writable only by owner
Executable program – everyone can run it
Process Management
These commands help you monitor and control running programs on your system.
& (background process)
Runs a command in the background so you can continue using the terminal.
ps
Shows information about running processes. Combine with grep to find specific programs.
top
Displays a live, updating view of system processes and resource usage.
kill
Stops a running process. Use -9 to force quit unresponsive programs.
lsof
Lists open files and which processes are using them.
Networking
These commands help you troubleshoot network connections and transfer data.
ifconfig
Shows network interface information and IP addresses.
netstat
Displays network connections, routing tables, and interface statistics.
ping
Tests connectivity to another host by sending echo requests.
whois & dig & host
Query domain registration and DNS information.
wget & curl
Download files from the internet or fetch web content.
Quick References
Here are a few related articles according to search queries
- How to secure Kali Linux and ensure your protection
- Autopsy Kali Linux
- The Ultimate Penetration Testing Command Cheat Sheet for Linux
- The Linux Command Line for Beginners
- Linux Commands with Examples
Ready to Have Some Fun with CommandLine
There are tons of Linux Commands cheat sheets, Linux commands guides, online articles, and books; we previewed the most recent and easy-to-implement commands. The description given alongside is specific search options for easy controls.
Sometimes it’s hard to find Linux commands when you don’t know the name or proper reference. So we thought of the concept beforehand and presented a beginner-friendly Linux Commands Cheat Sheet.
And there you have it – your essential toolkit for mastering the Linux terminal. From navigating folders with ls and cd to managing processes with ps and kill, you’ve now got the power to control your system with precision. Remember, you don’t need to memorize everything at once. Bookmark this guide and come back whenever you’re stuck. The real magic happens when you start using these commands in your daily work. Try creating a script, searching through log files, or managing your system’s resources. Each small step will build your confidence. The terminal isn’t just for experts – it’s for anyone who wants to work smarter and faster. So go ahead, open that black window and start exploring. You’ve got this.