The Ultimate "Cheat Sheet" with Essential Commands for Linux, Git, and GitHub: A DevOps Engineer's Guide ๐Ÿ“๐Ÿง๐Ÿš€

ยท

3 min read

Introduction:

As a DevOps Engineer, mastering the command-line interface is crucial for efficient development and collaboration. In this comprehensive "cheat sheet" blog, we will compile all the essential commands you've learned so far for Linux, Git, and GitHub. Whether you're a seasoned professional or just starting your journey, this guide will serve as a quick reference to boost your productivity and streamline your daily tasks.

  1. Linux Commands:

1.1 File System and Navigation:

  • pwd: Print the current working directory.

  • ls: List files and directories in the current directory.

  • cd: Change directory.

  • mkdir: Create a new directory.

  • touch: Create a new file.

  • rm: Remove files or directories.

  • cp: Copy files or directories.

  • mv: Move or rename files or directories.

1.2 File Manipulation:

  • cat: Concatenate and display file content.

  • less: Display file content interactively.

  • head: Display the beginning of a file.

  • tail: Display the end of a file.

  • grep: Search for a specific pattern in files.

  • find: Search for files and directories.

1.3 Process Management:

  • ps: Show running processes.

  • kill: Terminate a process.

  • top: Display real-time system metrics.

  1. Git and GitHub Commands:

2.1 Git Basics:

  • git init: Initialize a new Git repository.

  • git clone: Clone a remote repository to a local directory.

  • git status: Show the status of the working directory.

  • git add: Add changes to the staging area.

  • git commit: Create a new commit with staged changes.

  • git push: Push local commits to a remote repository.

  • git pull: Fetch and merge changes from a remote repository.

2.2 Branching and Merging:

  • git branch: List branches and create new ones.

  • git checkout: Switch to a different branch.

  • git merge: Merge changes from one branch into the current branch.

  • git rebase: Apply changes from one branch on top of another.

2.3 Remote Repositories:

  • git remote: List remote repositories.

  • git fetch: Fetch changes from a remote repository without merging.

  • git clone: Clone a remote repository to a local directory.

  • git remote add: Add a new remote repository.

  • git remote remove: Remove a remote repository.

2.4 Collaboration:

  • git log: View commit history.

  • git diff: Show differences between commits or files.

  • git blame: Show who changed which lines in a file.

  • git stash: Temporarily save changes without committing.

  1. GitHub Commands:

3.1 Working with Repositories:

  • git remote -v: View remote repository URLs.

  • git push origin <branch_name>: Push changes to a specific branch on GitHub.

  • git pull origin <branch_name>: Pull changes from a specific branch on GitHub.

  • git clone <repository_url>: Clone a remote repository to your local machine.

3.2 Collaboration:

  • Pull Requests: Submit and review pull requests for code collaboration.

  • Issues: Create, track, and manage issues for bug tracking and feature requests.

Conclusion:

This "cheat sheet" serves as a valuable resource for DevOps Engineers, providing quick access to essential commands for Linux, Git, and GitHub. Whether you need to navigate the Linux file system, manage Git repositories, or collaborate on GitHub projects, these commands will streamline your workflow and boost your productivity. Keep this guide handy and continue exploring more advanced features to become a proficient DevOps Engineer. Happy coding and collaborating! ๐Ÿ“๐Ÿง๐Ÿš€

ย