Day 12 - Linux & DevOps Commands Cheat-Sheet ๐Ÿ’ป

ยท

2 min read

Day 12 - Linux & DevOps Commands Cheat-Sheet ๐Ÿ’ป

๐Ÿš€ Mastering Git and Linux: Your Ultimate Cheat Sheet

Are you ready to level up your Git and Linux skills? Look no further! This comprehensive cheat sheet is your go-to guide for mastering essential commands and shortcuts in Git and Linux. Whether you're a beginner or an experienced developer, these commands will help you streamline your workflow and become more productive. Let's dive in!

Git Cheat Sheet ๐ŸŒŸ

Basic Commands:

  • Initialize a Repository:

      git init
    
  • Clone a Repository:

      git clone <repository_url>
    
  • Add Changes to Staging Area:

      git add <file>
    
  • Commit Changes:

      git commit -m "Commit message"
    
  • View Repository Status:

      git status
    

Branching and Merging:

  • Create a New Branch:

      git branch <branch_name>
    
  • Switch to a Branch:

      git checkout <branch_name>
    
  • Merge Branches:

      git merge <branch_name>
    

Undoing Changes:

  • Undo Last Commit:

      git reset HEAD~1
    
  • Discard Changes in Working Directory:

      git checkout -- <file>
    
  • Revert a Commit:

      git revert <commit_hash>
    

Remote Operations:

  • Add Remote Repository:

      git remote add origin <repository_url>
    
  • Push Changes to Remote Repository:

      git push origin <branch_name>
    
  • Pull Changes from Remote Repository:

      git pull origin <branch_name>
    

Linux Cheat Sheet ๐Ÿ’ป

File System Navigation:

  • Change Directory:

      cd <directory>
    
  • List Directory Contents:

      ls
    
  • Create a New Directory:

      mkdir <directory_name>
    
  • Remove a File or Directory:

      rm <file/directory>
    

File Operations:

  • Copy File:

      cp <source> <destination>
    
  • Move/Rename File:

      mv <source> <destination>
    
  • View File Content:

      cat <file>
    

System Operations:

  • Check System Information:

      uname -a
    
  • List Running Processes:

      ps aux
    
  • Shutdown System:

      shutdown now
    

Network Operations:

  • Check Network Configuration:

      ifconfig
    
  • Ping a Host:

      ping <host>
    
  • Transfer Files over SSH:

      scp <file> <username>@<hostname>:<destination>
    

With this cheat sheet at your fingertips, you'll be navigating Git repositories and Linux systems like a pro in no time! Happy coding! ๐Ÿš€โœจ

ย