Skip to main content

Command Palette

Search for a command to run...

Basic Linux Commands

Published
β€’2 min read
A

DevOps engineer sharing daily learnings on Linux, Docker, Kubernetes, CI/CD, and Cloud.

Linux is controlled mainly through the command line.
Knowing basic Linux commands helps you:

  • Navigate the file system

  • Manage files and directories

  • Inspect system information

  • Work efficiently on servers

This guide covers the most commonly used Linux commands in the beginning.

Basic Commands used in day-to-day activities

  1. Navigation Commands

    pwd – Print Working Directory

     pwd
    

    Shows your current location in the file system.

    ls – List Files and Directories

     ls
     ls -l
     ls -a
    

    cd – Change Directory

     cd /etc
     cd ..
     cd ~
    
  2. File & Directory Management

    mkdir – Create Directory

     mkdir logs
    

    touch – Create Empty File

     touch file.txt
    

    cp – Copy Files

     cp file.txt backup.txt
    

    mv – Move / Rename Files

     mv file.txt newfile.txt
    

    rm – Remove Files

     rm file.txt
     rm -r folder
    
  3. Viewing File Content

    cat

     cat file.txt
    

    head / tail

     head file.txt
     tail -f app.log
    
  4. File Search & Filters

    grep

     grep "error" app.log
    

    find

     find /var/log -name "*.log"
    
  5. System Information Commands

     df -h     # Disk usage
     du -sh *  # Directory size
     free -m   # Memory usage
     uptime   # System running time
     whoami   # Current user
    
  6. Networking Basics

     ping google.com
     curl https://example.com
     wget https://example.com/file.zip
    

Common Beginner Mistakes ⚠️

  • Using rm -rf / blindly

  • Forgetting file paths

  • Running commands as root unnecessarily

  • Ignoring command options (-h, --help)

πŸ”š Conclusion

Mastering basic Linux commands is the foundation of Linux, DevOps, and Cloud work.
These commands are used daily on servers and production systems.

Linux Essentials

Part 4 of 5

Linux Essentials is a practical series covering core Linux concepts from a DevOps perspectiveβ€”architecture, filesystem, permissions, processes, networking, and servicesβ€”focused on real-world usage in production and cloud environments.

Up next

File Permissions & Ownership

Linux is a multi-user operating system, so it needs a strong permission system to control who can access what.File permissions and ownership define security, access control, and system stability. In this blog, we will learn: How Linux permissions wo...