Linux Commands Cheat Sheet

This cheatsheet is designed to help you navigate the command line efficiently.


Welcome to the Linux Command Cheatsheet, a quick reference guide for essential Linux commands. Whether you’re a beginner or an experienced user, this cheatsheet is designed to help you navigate the command line efficiently. Each entry provides a brief description and example usage to assist you in mastering these powerful commands.

Table of Contents

  1. File System Navigation

    CommandDescriptionExampleFurther Reference
    cdChange directorycd DocumentsOfficial Documentation
    lsList directory contentsls -lGNU Coreutils
    pwdPrint working directorypwdGNU Coreutils
  2. File Operations

    CommandDescriptionExampleFurther Reference
    cpCopy files/directoriescp file.txt /path/to/destinationGNU Coreutils
    mvMove/rename files/directoriesmv old.txt new.txtGNU Coreutils
    rmRemove/delete filesrm file.txtGNU Coreutils
  3. Directory Operations

    CommandDescriptionExampleFurther Reference
    mkdirCreate a new directorymkdir my_folderGNU Coreutils
    rmdirRemove an empty directoryrmdir empty_folderGNU Coreutils
    rm -rRemove a directory and its contentsrm -r my_folderGNU Coreutils
  4. Text File Manipulation

    CommandDescriptionExampleFurther Reference
    catDisplay file contentscat file.txtGNU Coreutils
    nanoText editor for file editingnano file.txtGNU Nano Manual
    grepSearch for a pattern in filesgrep "pattern" file.txtGNU Grep Manual
  5. User and Permission Management

    CommandDescriptionExampleFurther Reference
    whoamiDisplay current usernamewhoamiGNU Coreutils
    chmodChange file permissionschmod 755 file.txtGNU Coreutils
    chownChange file ownerchown user:group file.txtGNU Coreutils
  6. System Information

    CommandDescriptionExampleFurther Reference
    unameDisplay system informationuname -aGNU Coreutils
    dfDisplay disk space usagedf -hGNU Coreutils
    topDisplay real-time system statisticstopLinux Top Command
  7. Package Management

    CommandDescriptionExampleFurther Reference
    apt-getPackage management for Debian-based systemsapt-get install packageDebian Apt-get Documentation
    yumPackage management for RPM-based systemsyum install packageYum Documentation
    pacmanPackage management for Arch Linuxpacman -S packageArch Linux Pacman
  8. Network Commands

    CommandDescriptionExampleFurther Reference
    ifconfigDisplay network interface informationifconfigLinux ifconfig Command
    pingTest network connectivityping google.comLinux Ping Command
    netstatDisplay network statisticsnetstat -aLinux Netstat Command
  9. Process Management

    CommandDescriptionExampleFurther Reference
    psDisplay information about active processesps auxLinux ps Command
    killTerminate a processkill -9 PIDLinux Kill Command
    htopInteractive process viewerhtophtop Documentation
  10. Archiving and Compression

    CommandDescriptionExampleFurther Reference
    tarCreate and extract tar archivestar -cvf archive.tar files/GNU Tar Manual
    gzipCompress or decompress filesgzip file.txtGNU Gzip Manual
    zipCreate a zip archivezip files/Info-ZIP Documentation

Feel free to bookmark this cheatsheet for quick access to commonly used Linux commands. Happy coding!