
Master the Linux Terminal: 50+ Commands Every Beginner Should Know in 2025
Table of Contents
- What Is a Linux Command?
- You Should Know Before Using the Command Line
- The Linux commands
- ls (List Files and Directories)
- cd (Change Directory)
- pwd (Print working directory)
- mkdir (Create a new folder)
- rmdir (Remove an empty folder)
- tree (Show directory tree)
- touch (Create an empty file)
- cp (Copy files/folders)
- mv (Move or Rename Files/Directories)
- rm (Remove Files and Directories)
- cat (View File Contents)
- nano (Edit files)
- vim (Advanced file editor)
- uname -a (Full system info)
- df -h (Disk space)
- free -m (Memory usage)
- top (Real-time process list)
- uptime (Show uptime)
- whoami (Current user)
- id (User ID and groups)
- adduser (Add a new user)
- passwd (Change password)
- chmod (Change permissions)
- chown (Change file owner)
- ping (Check connectivity)
- ifconfig (Network config)
- curl (Fetch URLs)
- wget (Download files)
- apt update (Refresh packages)
- apt upgrade (Install updates)
- apt install (Install software)
- apt remove (Uninstall software)
- ps (View processes)
- kill (Stop process by ID)
- htop (Interactive process viewer)
- clear ( Clear the terminal display)
- tail (View the Last Part of a File)
- diff (Compare Two Files Line by Line)
- cmp (Compare Two Files Byte by Byte)
- comm (Compare Two Sorted Files Line by Line)
- sort (Sort Text Files Line by Line)
- export (Set Environment Variables in Shell)
- zip (Compress Files and Directories)
- unzip (Extract ZIP Archives)
- ssh (Secure Remote Login)
- service (Manage System Services)
- alias (Create Custom Shortcuts for Commands)
- unalias (Remove Command Shortcuts)
- man (Manual Pages Viewer)
- exit (Close the Current Terminal )
- echo (Display Messages in Terminal)
- history (View Past Commands)
- which (Find the Location of Executables in Linux)
- head (View the Beginning of a File)
- grep (Search Text or Patterns)
- Conclusion
Whether you're a developer, system administrator, or tech enthusiast, mastering the Linux terminal is essential. This blog post provides over 50+ powerful and beginner-friendly Linux commands, complete with syntax, examples, and simplified explanations to help you become comfortable and efficient with the terminal in 2025.
What Is a Linux Command?
A Linux command is a text-based instruction that you type into the terminal (also called the command line) to tell your Linux system to do something.
These commands are used to:
- Navigate through files and folders
- Create, delete, or move files
- Install or remove software
- Manage users and permissions
- Control system settings
You Should Know Before Using the Command Line
Before running Linux commands, make sure you have:
-
Access to a Linux Environment
- Install Linux (like Ubuntu or Fedora) on your system.
- Use a virtual machine (e.g., VirtualBox or VMware).
- For Windows? Enable WSL (Windows Subsystem for Linux).
-
Terminal Basics
Open Terminal
- Linux/macOS: Press Ctrl + Alt + T or search “Terminal”.
- Windows (WSL)Type wsl in Command Prompt.
Helpful Shortcuts:
- Tab: Auto-completes commands or filenames.
- Ctrl + C: Stops the running process.
- Up/Down Arrow: Scroll through command history.
The Linux commands
Try It Yourself: !Open Terminal and type:
-
ls (List Files and Directories)
ls stands for "list" and is used to display the contents of a directory. Whether it's files, folders, or hidden items, ls helps you see what's inside your current working directory or any other directory you specify.
Syntax:
Examples:
-
cd (Change Directory)
It is one of the most basic and frequently used commands in the Linux terminal. With cd, you can move between different folders (directories) in your system. Think of it like navigating through folders on your computer using the command line instead of clicking through file explorer.
Syntax:
Examples:
-
pwd (Print working directory)
It shows you the full path of your current location in the terminal. Whenever you're lost or unsure which folder you're in while using the command line, just type pwd — it instantly tells you where you are
Syntax:
Examples:
-
mkdir (Create a new folder)
The mkdir command in Linux stands for "make directory". As the name suggests, it's used to create new folders (directories) in your system. Whether you're organizing files, creating project structures, or setting up workspaces — mkdir makes it easy to build your directory tree right from the terminal.
Syntax:
Examples:
This command creates a folder named projects in the current directory.
-
rmdir (Remove an empty folder)
The rmdir command in Linux is used to remove (delete) empty directories. If you've created a folder and no longer need it — and it's empty — rmdir is the cleanest way to delete it from your system.
Syntax:
Examples:
This command will delete the old_folder directory only if it's empty.
-
tree (Show directory tree)
The tree command in Linux is a handy tool that displays directories and files in a tree-like structure. It visually shows how folders and files are organized inside a directory, making it easier to understand the file hierarchy at a glance.
Syntax:
Examples:
If the tree command is not found, you can install it using:
-
touch (Create an empty file)
The touch command in Linux is used to create empty files quickly or update the timestamp of existing files. It's one of the easiest ways to generate new files without opening an editor.
Syntax:
Examples:
This will create an empty file named myfile.txt in the current directory.
-
cp (Copy files/folders)
The cp command in Linux is used to copy files and directories from one location to another. It's a handy tool when you want to duplicate data or back up important files.
Syntax:
Examples:
This command copies file.txt to a new file named backup.txt.
-
mv (Move or Rename Files/Directories)
The mv command in Linux is used to move or rename files and directories. It's like cutting and pasting files from one place to another. If the source and destination are in the same location, it simply renames the file.
Syntax:
Examples:
-
rm (Remove Files and Directories)
The rm command in Linux is used to delete files and directories from the system. Once removed, the files are not moved to trash—they're permanently deleted, so use it with care!
Syntax:
Examples:
-
cat (View File Contents)
The cat command (short for concatenate) in Linux is used to display the content of files, create new files, or join multiple files together. It's one of the most commonly used commands to quickly view text files right in the terminal.
Syntax:
Examples:
-
nano (Edit files)
The nano command opens a simple, easy-to-use text editor directly in your Linux terminal. It's perfect for beginners who want to edit files without the complexity of advanced editors like Vim. With nano, you can create, view, and edit text files in a clean and intuitive interface.
Syntax:
Examples:
-
vim (Advanced file editor)
The vim command opens Vim, a powerful and highly configurable text editor used in the Linux terminal. It's designed for efficiency and is a favorite among developers and sysadmins. While it may seem tricky at first, Vim becomes a super tool once you learn the basics.
Syntax:
Examples:
-
uname -a (Full system info)
The uname -a command in Linux displays complete system information in one line. It shows details like the kernel name, version, machine type, and operating system — all useful for understanding your system at a glance.
Syntax:
Examples:
-
df -h (Disk space)
The df -h command in Linux is used to check disk space usage in a human-readable format. It shows how much space is used, available, and where your system is storing files — using MBs and GBs for easier understanding.
Syntax:
Examples:
-
free -m (Memory usage)
The free -m command in Linux is used to check your system's memory (RAM) usage in megabytes (MB). It gives you a quick snapshot of how much memory is available, used, or free — making it super helpful for performance monitoring.
Syntax:
Examples:
-
top (Real-time process list)
The top command in Linux is like Task Manager for the terminal. It gives you a real-time view of system processes, showing how much CPU and memory each process is using.
Syntax:
Examples:
-
uptime (Show uptime)
The uptime command in Linux tells you how long your system has been running without a restart. It also shows the current time, number of users, and the system's load average—a quick snapshot of your system's performance.
Syntax:
Examples:
-
whoami (Current user)
The whoami command in Linux is a quick and easy way to find out which user you're currently logged in as. It simply prints your active username on the terminal.
Syntax:
Examples:
-
id (User ID and groups)
The id command in Linux is used to display the user ID (UID), group ID (GID), and all the groups the current user belongs to. It's a quick way to understand user permissions and access levels.
Syntax:
Examples:
-
adduser (Add a new user)
The adduser command in Linux is a user-friendly tool to create a new user account on your system. It automatically sets up the user's home directory, shell, and prompts for a password — making user creation quick and easy for beginners.
Syntax:
Examples:
-
passwd (Change password)
The passwd command in Linux is used to change or update a user's password. It's a quick and secure way to manage access credentials for yourself or other users on the system.
Syntax:
Examples:
-
chmod (Change permissions)
The chmod command in Linux is used to change the permissions of files and directories. It lets you control who can read, write, or execute a file — making your system more secure and organized.
Syntax:
Examples:
-
chown (Change file owner)
The chown command in Linux is used to change the ownership of a file or directory. It lets you assign a different user or group as the owner, giving control over who manages the resource.
Syntax:
Examples:
-
ping (Check connectivity)
The ping command is a basic networking tool used to check the connection between your computer and another device or server.
Syntax:
Examples:
-
ifconfig (Network config)
The ifconfig (interface configuration) command is a useful tool in Linux for viewing and configuring network interfaces on your system. Think of it as a quick way to check your computer's IP address, MAC address, and network status.
Syntax:
Examples:
-
curl (Fetch URLs)
The curl command is a powerful tool in Linux used to transfer data from or to a server using various protocols like HTTP, HTTPS, FTP, and more. It's commonly used by developers to test APIs, download files, or interact with web services—all from the command line.
Syntax:
Examples:
-
wget (Download files)
The wget command is a handy tool in Linux used to download files from the internet directly to your system. It works with HTTP, HTTPS, and FTP protocols, making it perfect for grabbing web pages, scripts, software packages, or entire websites.
Syntax:
Examples:
-
apt update (Refresh packages)
The apt update command in Linux is used to refresh the package list from all configured repositories. It checks for the latest versions of available packages but doesn't install or upgrade anything—just updates the information.
Syntax:
Examples:
-
apt upgrade (Install updates)
The apt upgrade command in Linux is used to install the latest versions of all currently installed packages on your system. After you've refreshed the package list with apt update, this command applies the actual updates.
Syntax:
Examples:
-
apt install (Install software)
The apt install command in Linux is used to download and install new software packages from the official repositories. Whether you need a text editor, browser, or any developer tool, this is the command to use.
Syntax:
Examples:
-
apt remove (Uninstall software)
The apt remove command in Linux is used to uninstall or delete installed packages from your system without affecting your personal files. It's a quick way to free up space or clean up unwanted applications.
Syntax:
Examples:
-
ps (View processes)
The ps command in Linux is used to display information about running processes on your system. It gives you a snapshot of what's currently happening in your system's memory — like which programs are running and who started them.
Syntax:
Examples:
-
kill (Stop process by ID)
The kill command in Linux is used to stop or terminate running processes manually by sending them a specific signal. Despite its name, kill doesn't always mean “destroy”—it just sends a signal, which can be used to gracefully stop or forcefully end a process.
Syntax:
Examples:
-
htop (Interactive process viewer)
The htop command is an interactive, real-time system-monitoring tool for Linux. Think of it as an advanced version of the top command — but with a colorful, user-friendly interface that lets you view and manage processes easily.
Syntax:
Examples:
-
clear ( Clear the terminal display)
The clear command in Linux is a quick and handy way to clean your terminal screen. It removes all the previous output, giving you a fresh and clutter-free workspace.
Syntax:
Examples:
-
tail (View the Last Part of a File)
The tail command in Linux is used to view the last few lines of a file, typically useful for checking recent log entries or updates in real-time.
Syntax:
Examples:
-
diff (Compare Two Files Line by Line)
The diff command in Linux is used to compare the contents of two files line by line. It highlights the differences between them, helping you spot changes, updates, or errors quickly. Whether you're comparing code files, documents, or configurations, diff gives you a clear and readable summary of what's been added, removed, or modified.
Syntax:
Examples:
file1.txt
file2.txt
Output:
-
cmp (Compare Two Files Byte by Byte)
The cmp command in Linux is used to compare two files byte by byte. Unlike diff, which shows all the changes line by line, cmp is more direct — it tells you where the first difference occurs (if any). If the files are identical, it silently returns nothing — a clean way to check for exact matches.
Syntax:
Examples:
file1.txt
file2.txt
Output:
-
comm (Compare Two Sorted Files Line by Line)
The comm command in Linux is used to compare two sorted files and display the lines that are common and different between them. It's a quick way to spot similarities and differences line-by-line.
Syntax:
Examples:
file1.txt
file2.txt
Output:
-
sort (Sort Text Files Line by Line)
The sort command in Linux is used to arrange lines of text files in a specific order, either alphabetically or numerically. It's a handy tool when you need to organize data quickly—like sorting names, numbers, or entire files in ascending or descending order.
Syntax:
Examples:
fruits.txt
Output:
-
export (Set Environment Variables in Shell)
The export command in Linux is used to set environment variables and make them available to child processes or subshells. It's a crucial command when you want your custom variables or changes to persist across different scripts or terminal sessions.
Syntax:
Examples:
-
zip (Compress Files and Directories)
The zip command in Linux is used to compress files and directories into a single .zip archive, helping you save space or share multiple files as one. It's widely used for packaging data quickly and efficiently.
Syntax:
Examples:
-
unzip (Extract ZIP Archives)
The unzip command in Linux is used to extract files from a .zip archive. It's a quick and simple way to unpack compressed files and access their contents right from the terminal.
Syntax:
Examples:
-
ssh (Secure Remote Login)
The ssh (Secure Shell) command is used to securely connect to a remote server or computer over a network. It encrypts all traffic to keep connections private and secure, making it essential for system administrators and developers who manage remote machines.
Syntax:
Examples:
-
service (Manage System Services)
The service command is used to start, stop, restart, or check the status of system services on a Linux system. It interacts with the system's init system (like System V or systemd) and is commonly used for managing services like Apache, MySQL, SSH, etc.
Syntax:
Examples:
-
alias (Create Custom Shortcuts for Commands)
The alias command in Linux is used to create shortcuts for long or frequently used commands. It helps save time and avoid typing lengthy command lines by giving them a simple, custom name.
Syntax:
Examples:
-
unalias (Remove Command Shortcuts)
The unalias command is used to remove or delete an alias that you've previously set using the alias command. It's useful when you want to get rid of a shortcut or restore a command to its original behavior.
Syntax:
Examples:
-
man (Manual Pages Viewer)
The man command (short for manual) is used to view the user manual of any command available on your Linux system. It provides detailed documentation including command usage, options, and examples
Syntax:
Examples:
-
exit (Close the Current Terminal )
The exit command is used to close the current terminal session or shell in Linux. Whether you're done with your tasks or running a script, this command helps you exit gracefully and return to the previous environment or logout completely.
Syntax:
Examples:
-
echo (Display Messages in Terminal)
The echo command in Linux is used to display text or variables to the terminal. It's one of the simplest and most commonly used commands—perfect for printing messages, debugging scripts, or showing the value of variables.
Syntax:
Examples:
-
history (View Past Commands)
The history command in Linux is used to view previously executed commands in the terminal. It's a handy tool for recalling past commands, debugging, or simply re-running a command without typing it again. This command improves productivity by saving time and reducing typing errors.
Syntax:
Examples:
-
which (Find the Location of Executables in Linux)
The which command in Linux is used to locate the full path of an executable that would run if you entered its name in the terminal. It searches through the directories listed in the $PATH environment variable and helps you understand which version of a command you're using.
Syntax:
Examples:
-
head (View the Beginning of a File)
The head command in Linux is used to display the first few lines of a file. By default, it shows the first 10 lines, but you can customize the number of lines using options. It's especially useful for quickly viewing the top portion of large files.
Syntax:
Examples:
-
grep (Search Text or Patterns)
The grep command is one of the most powerful tools in Linux. It's used to search for specific text or patterns within files or output. If you want to quickly find a line that contains a keyword, grep is your go-to command.
Syntax:
Examples:
Read Also: Mastering Git: A Beginner's Guide to Essential Commands and Workflow
Conclusion
Learning these 50+ Linux terminal commands is a great first step toward becoming comfortable with the command line. Whether you're just starting out or want to improve your skills, these basic commands will help you navigate, manage files, and perform tasks more efficiently. Keep practicing regularly, and soon you'll feel right at home in the Linux terminal.
0 Comments