Master the Linux Terminal: 50+ Commands Every Beginner Should Know in 2025

featured_img1744204546.webp

Master the Linux Terminal: 50+ Commands Every Beginner Should Know in 2025

Table of Contents

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:

  1. 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).
  2. 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:

  1. 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:

    ls [options] [directory]

    Examples:

    ls
    # Output: Documents  Downloads  Music  Pictures  Videos
    
    # Options
    ls          # List files in current dir
    ls -l       # Detailed list (permissions, size)
    ls -a       # Show hidden files (like .bashrc)
    ls -lh      # Human-readable file sizes (like KB, MB).
  2. 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:

    cd [directory]

    Examples:

    cd /home    # Move to /home
    cd ..       # Go back one folder
    cd ~        # Go to home directory
  3. 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:

    pwd

    Examples:

    pwd
    # Output: /home/username
  4. 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:

    mkdir [options] directory_name

    Examples:

    mkdir projects

    This command creates a folder named projects in the current directory.

  5. 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:

    rmdir [options] directory_name

    Examples:

    rmdir old_folder
    
    # Options
    rm -r          # For deleting non-empty directories

    This command will delete the old_folder directory only if it's empty.

  6. 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:

    tree [options] [directory]

    Examples:

    tree
    .
    ├── file1.txt
    ├── folder1
    │   └── file2.txt
    └── folder2
        └── file3.txt

    If the tree command is not found, you can install it using:

    sudo apt install tree   # For Debian/Ubuntu
    sudo yum install tree   # For RHEL/CentOS
  7. 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:

    touch [filename]

    Examples:

    touch myfile.txt

    This will create an empty file named myfile.txt in the current directory.

  8. 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:

    cp [source] [destination]

    Examples:

    cp file.txt backup.txt
    
    # Options
    cp -r    # To copy entire folders (with their contents)
    cp -i    # To get a warning before overwriting files

    This command copies file.txt to a new file named backup.txt.

  9. 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:

    mv [source] [destination]

    Examples:

    mv notes.txt /home/user/Documents/
    
    # Options
    mv -i    # To confirm before overwriting
  10. 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:

    rm [options] [file/directory]

    Examples:

    rm sample.txt
    
    # Options
    rm -r    # To Delete a folder and its contents
    rm -i    # To confirm before deleting
  11. 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:

    cat [options] [file_name]

    Examples:

    cat notes.txt
    
    # Options
    cat >     # To Create a new file
    cat -n    # To Number lines in a file
  12. 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:

    nano [file_name]

    Examples:

    nano notes.txt
    sudo nano /etc/hosts
    
    # Controls Options
    Ctrl + O    # Save changes
    Ctrl + X    # Exit editor
    Ctrl + W    # Search inside the file
  13. 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:

    vim [file_name]

    Examples:

    vim myfile.txt
    sudo vim /etc/hosts
    
    # Controls Options
    i     # Enter insert mode
    :w    # Save the file
    :q    # Quit
    :wq   # Save and quit
    dd    # Delete a line
  14. 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:

    uname -a

    Examples:

    uname -a
    Linux ubuntu 5.15.0-84-generic # 93-Ubuntu SMP x86_64 GNU/Linux
  15. 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:

    df -h

    Examples:

    df -h
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/sda1        50G   20G   28G  42% /
  16. 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:

    free -m

    Examples:

    free -m
    total          used        free        shared      buff/cache   available
    Mem:           7972        3020        1521         118        3430        4420
    Swap:          2047           0        2047
  17. 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:

    top

    Examples:

    PID   USER     %CPU   %MEM   COMMAND
    1234  root     15.3   10.2   chrome
    5678  ubuntu    5.0    2.1   code
  18. 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:

    uptime

    Examples:

    10:45:01 up 3 days, 2:18,  2 users,  load average: 0.15, 0.10, 0.05
  19. 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:

    whoami

    Examples:

    whoami
    
    # Output: ASUS
  20. 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:

    id

    Examples:

    id
    
    # Output: uid=197605(ASUS) gid=199121 groups=199121
  21. 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:

    sudo adduser username

    Examples:

    sudo adduser ASUS
  22. 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:

    passwd [username]

    Examples:

    passwd
    sudo passwd ASUS
  23. 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:

    chmod [permissions] [filename]

    Examples:

    chmod 755 script.sh
  24. 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:

    chown [user]:[group] [file or directory]

    Examples:

    chown john:developers project.txt
  25. 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:

    ping [hostname or IP address]

    Examples:

    ping tipinfotrove.com
  26. 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:

    ifconfig

    Examples:

    ifconfig eth0
  27. 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:

    curl [options] [URL]

    Examples:

    curl https://example.com
  28. 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:

    wget [options] [URL]

    Examples:

    wget https://example.com/file.zip
  29. 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:

    sudo apt update

    Examples:

    sudo apt update
  30. 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:

    sudo apt upgrade

    Examples:

    sudo apt upgrade
  31. 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:

    sudo apt install [package-name]

    Examples:

    sudo apt install git
  32. 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:

    sudo apt remove [package-name]

    Examples:

    sudo apt remove firefox
  33. 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:

    ps

    Examples:

    ps aux
  34. 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:

    kill [signal] PID

    Examples:

    kill -9 1234
  35. 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:

    htop

    Examples:

    sudo apt install htop
  36. 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:

    clear

    Examples:

    clear
  37. 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:

    tail [options] filename

    Examples:

    tail log.txt
    
    tail -n 5 log.txt   # To see the last 5 lines
    tail -f log.txt     # Watch a live-updating log
  38. 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:

    diff [options] file1 file2

    Examples:

    file1.txt

    Hello
    Welcome to Linux
    This is line three

    file2.txt

    Hello
    Welcome to Ubuntu
    This is line three

    Output:

    diff file1.txt file2.txt
    
    # Output
    2c2
    < Welcome to Linux
    ---
    > Welcome to Ubuntu
  39. 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:

    cmp [options] file1 file2

    Examples:

    file1.txt

    Linux is fun

    file2.txt

    Linux is run

    Output:

    $ cmp file1.txt file2.txt
    
    # Output
    file1.txt file2.txt differ: byte 10, line 1
  40. 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:

    comm [options] file1 file2

    Examples:

    file1.txt

    apple
    banana
    mango

    file2.txt

    banana
    grape
    mango

    Output:

    comm file1.txt file2.txt
    
    # Output
    apple
        grape
        banana
        mango
  41. 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:

    sort [options] [file]

    Examples:

    fruits.txt

    banana
    apple
    mango
    grape

    Output:

    sort fruits.txt
    
    # Output
    apple
    banana
    grape
    mango
  42. 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:

    export VARIABLE_NAME=value

    Examples:

    export MY_NAME="ASUS"
  43. 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:

    zip [options] archive_name.zip file1 file2 ...

    Examples:

    zip my_files.zip file1.txt file2.txt
    
    zip -r project.zip /home/user/project   # Including Subfolders
    zip -e secret.zip confidential.txt      # Password-Protected Zip
  44. 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:

    unzip [options] archive_name.zip

    Examples:

    unzip my_files.zip
    
    unzip my_files.zip -d extracted_folder/ #Extract to a Specific Directory
  45. 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:

    ssh [username]@[hostname or IP address]

    Examples:

    ssh asus@192.168.1.100
  46. 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:

    service [service_name] [action]

    Examples:

    Example1:  service apache2 start      # Start a Service
    Example2:  service apache2 restart    # Restart  a Service
    Example3:  service apache2 stop       # Stop  a Service
    Example4:  service apache2 status     # Check Service Status
  47. 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:

    alias shortcut_name='your_command_here'

    Examples:

    Example1: alias ll='ls -la'
    Example2: alias update='sudo apt update && sudo apt upgrade'
  48. 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:

    unalias alias_name
    unalias -a   # To remove all aliases at once

    Examples:

    unalias ll
  49. 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:

    man [command_name]

    Examples:

    man ls
  50. 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:

    exit [n]

    Examples:

    exit
    exit 1  # Exit with a status code
  51. 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:

    echo [option] [string]

    Examples:

    # Example1: echo "Hello, Linux World!"
    # Output1: Hello, Linux World!
    
    
    # Example2: name="ASUS"
              echo "My name is $name"
    
    
    # Output2: My name is ASUS
  52. 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:

    history [options]

    Examples:

    history
    
    # Output:
    1  ls
    2  cd Documents
    3  mkdir test
    4  echo "Hello World"
    
    history -c  # Clear the history
  53. 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:

    which [command-name]

    Examples:

    which python
    
    # Output: /usr/bin/python
  54. 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:

    head [options] [filename]

    Examples:

    head sample.txt        # Display the first 10 lines of a file
    head -n 5 sample.txt   # Show the first 5 lines of a file
  55. 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:

    grep [options] pattern [filename]

    Examples:

    grep "hello" notes.txt       # Find a word in a file
    grep -r "config" /etc        # Search recursively in all files within a directory
    grep -i "linux" article.txt  # Ignore case sensitivity

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.

Did this solution work for you? Drop a like or comment below!

Satish Parmar

Satish Parmar

Experienced Full-Stack Web Developer

I'm a passionate full-stack developer and blogger from India, dedicated to sharing web development tips and solutions. As the creator of TipInfoTrove.com, my goal is to help developers and tech enthusiasts solve real-world challenges with expertise in PHP, Laravel, JavaScript, Vue, React, and more. Through detailed guides and practical insights, I strive to empower others to excel in their projects and stay ahead in the ever-evolving world of technology.

0 Comments

Post Comment

Your email address will not be published. Required fields are marked *