Skip to main content

Command Palette

Search for a command to run...

Must-Know Linux Commands & Tips for Beginners – A Practical Guide for Everyday Use

Published
5 min read
Must-Know Linux Commands & Tips for Beginners – A Practical Guide for Everyday Use

Introduction

Linux is one of the most powerful Operating Systems used by developers, system administrators, ethical hackers and even students who want full control over their machine.

But beginners often get confused by the huge number of commands available. They also copy-paste commands without understanding what they do.

In this blog, I’m sharing the most useful Linux commands and practical tips that I personally use daily — especially on Arch Linux & Hyprland setups.

Whether you’re new to Linux or want to sharpen your skills, this guide is for you.


ls — Listing Files and Directories

  • What does it do?

    It shows all files and folders in the current directory, as shown in the attached image.

  • Why is it important?

    Because it is the first command you use to understand “where you are” and what exists in your folder.

  • Examples

    One of the simple examples shown above, but the ls command doesn’t show hidden files directly. So, there are some flags attached to each command in Linux.

      ls -a       # Shows all files including hidden one
    
      ls -l       # Shows detailed info - permissions, owner, file size etc.
    


cd — Change Directory

  • What does it do?

    It moves you from one directory to another.

  • Why is it important?

    Because Linux file navigation is mostly done through the shell.

  • Examples

      cd Images          # Move into the Images folder
    

    There are two special commands related to cd -

      cd ..               # Move into the parent directory from where you came
    
      cd ~                # Move into the home(root) directory
    

    Tip: Use Tab to auto-complete the files/directories name.


pwd — Present Working Directory

  • What does it do?

    It shows the exact current location in the file system.

  • Why is it important?

    Sometimes, you may get lost in the nested folders. At that moment, pwd will work as a GPS for you.


mkdir — Creating Directories

  • What does it do?

    It is used to create new folders.

  • Examples

      mkdir src                      # Creates a folder 'src' into the present directory
    
      mkdir -p src/components/utils         # Creates nested directories (without erros)
    

    In the attached image, you can see that initially, there was no src folder in the current directory. After running the command mkdir src, it created the src folder. After that, I have run mkdir -p src/components/utils , which created components folder inside the src folder and utils folder inside the components folder.


cp — Copying Files and Folders

  • What does it do?

    It duplicates a file or a folder.

  • Examples

      # cp <source file path> <destination file path>
      cp ~/Desktop/file.txt ~/Downloads/backup.txt
    
      cp -r folder1 folder2        # Copy folder1 into folder2 recursively
    

    The -r flag is used to copy the folder recursively. Recursive copy means copying all the files and folders present inside the folder, not just the folder.


mv — Moving or Renaming

  • What does it do?

    It moves files from one directory to another or renames files.

    Renaming a file is just moving it in the same directory with different name.

  • Examples

      # mv <source file path> <destination file path>
      mv code.zip ~/Desktop           # Moves code.zip file to Desktop folder
    
      mv code.zip new_code.zip        # Rename the file
    

    Initially, there was no code.zip file inside Desktop folder. I went to the Downloads folder first and moved the file to the Desktop folder. You can see in the listed files. After that, I have run mv code.zip new_code.zip command that renamed the file as new_code.zip.


rm — Removing Files

  • What does it do?

    It deletes files or folders from the file system.

  • Examples

      rm file.txt                       # Deletes the file named file.txt
    
      rm -r folder                      # Deletes the folder recursively
    

    One thing you need to understand is that while deleting a folder, you first need to delete all the content inside it. That’s why -r flag is used here. It will remove all the content inside the folder recursively, but it will ask permission if the file is write-protected or owned by someone else.

    If you want to force delete everything, you can use the following command:

      rm -rf folder                    # Deletes everything forcefully without permission
    

    💡 Safety Tip: Never run sudo rm -rf /


Viewing Commands (cat, head, tail)

  • cat

    It shows the entire file content.

      cat ingenuity.cpp
    

  • head

    It shows the first 10 lines of the file.

      head ingenuity.cpp                   # By default shows first 10 lines
    
      head -15 ingenuity.cpp               # Shows first 15 lines
    

  • tail

    It shows the last 10 lines of the file.

      tail ingenuity.cpp                  # By default shows last 10 lines
    
      tail -15 ingenuity.cpp              # Shows last 15 lines
    


Conclusion

Linux is not about memorising the commands — it’s about understanding how they work. Once you know why and how a command works, the terminal becomes your superpower. The more you use the terminal, the faster and more efficient you become. Start by practising these commands daily, and soon you’ll feel fully in control of your environment — whether you’re managing files, troubleshooting coding, or customising your Linux.

💬 If you have any doubts, feel free to comment below or ask your queries — I’ll be happy to help!

21 views